Posts

Showing posts from July, 2015

Xcode stays on "Running" but don't run my app -

Image
i updated mac mountain lion , installed last version ox xcode (4.6.3) , works fine until want run application. compile , stay on "running" no app launched. , have force quit xcode stop state, frozen, still reacting mouse inputs. i reinstalled xcode, tried different apple xcode projects issue stays same. any idea? thanks. have tried resetting simulator? ios simulator menu > reset content , settings if didn't work, change debugger of application none. in xcode: app scheme > edit scheme > side menu choose "run yourapp.app" > info tab > debugger menu choose "none" then try running application.

Get Liferay's current user when integrate with spring web flow -

spring web flows introduced variable currentuser returns authenticated principal user. in liferay return null , hence breaks. if want authenticated liferay user, can call: portalutil.getuser(portletrequest);

java - How to convert an IOS app that uses an internal URL scheme for updating list items to an Android app that does the same -

the ios version of application populating menus , listviews internal urls define content. goal point admin can update content , list items web , database periodically updated changes using rest apis. i've read ios has more support internal url schemes android has. i've read people saying not idea in android.

asp.net - Unable to update jQuery mCustomScrollbar -

i'm using custom scrollbar http://manos.malihu.gr/jquery-custom-content-scroller/ . i'm using on div contains gridview. when new row added gridview, , exceeds size, scroll bars not being displayed. and have issue there div within , i'm using button toggle display of div. i'm unable update scrollbar (function($) { $(window).load(function() { $("#rightfixed").mcustomscrollbar({ scrollinertia: 150, autohidescrollbar: true, updateonbrowserresize: true, updateoncontentresize: true, theme: "dark-2" }); }); })(jquery); $(function () { $("#showtax").click(function () { $("#carttaxdiv").slidetoggle(); $(this).text($(this).text() == 'show tax' ? 'hide tax' : 'show tax'); $('#rightfixed').mcustomscrollbar("update"); }); }); one thing scrollbar initialization event in $(window).load , button click in $(document).ready . can me ?? i've figured out solution. for slide

html - How to remove padding for Jquery Mobile Panel form? -

as add form tag nasty padding around form elements. there way around this? screenshot: https://s3.amazonaws.com/thom-temp/jquerymobile-wtf.png <div id="advancedsearch" data-role="panel" data-position="right" data-display="push"> <div data-role="header"> <h1>search</h1> <a id="searchbutton" href="#" class="ui-btn-right" data-role="button" data-theme="d" data-icon="search">go</a> </div> <div data-role="content"> <form style="margin: 0px; padding: 0px;" id="yw2" action="/mshi/index-test.php/inspection/list" method="get"> <ul data-role="listview" data-inset="false" data-theme="a"> <li data-role="fieldcontain"> <input placeholder="id" name="inspection[id]"

vi - vim select and copy text between two files -

i have following scenario, 2 open files vim -o2 file1.txt file2.txt my cursor in file1.txt. want select lines (say line 80 100) in file2.txt without having move cursor file2.txt , yank there text. , if possible using command line of vim. have suggestion? thanks. the closest can think of is: :bn|80,100y|bp|pu switch next buffer yank switch back put yanked stuff

aggregate functions - Get rid of #Error in Access 2007 group footer report -

i creating report in access 2007 , want average, maximum, , minimum of several lab results. when enter following in control source box, #error message in group footer when records being subtotaled null when displaying report. how can rid of #error , have results return no value @ all. =cdbl(avg([arsenic])) thus data might in report serum _______________________ arsenic iron 30 10 30 15 ____________________ avg 25 10 max 30 10 min 15 10 __________________________ liver __________________________ arsenic iron 8 0 2 ____________________ avg #error 5 max #error 8 min #error 0 many thanks if use =avg([arsenic]) , it'll blank. whats causing #error when avg() returns blank, cdbl has null input. if absolutely must have cdbl() whatever reason, =iif(avg([arsenic]) null,"",cdbl(avg([arsenic

constructor - C#/MEF don't work with [ImportingConstrutor] with default values -

i have more or less same problem in question: c#/mef doesn't work base class without parameterless constructor i understand answer well. mef doesn't know value val not able create instance. but have no base ctor call , default value val: [export(typeof(iprimitivedecomposer))] public class prim : iprimitivedecomposer { [importingconstructor] public prim(int val=0) {//some code } public bool match(node node) {return true;} } the code compiles fine, mef doesn't seem have export iprimitivedecomposer when ask it. when following works fine: [export(typeof(iprimitivedecomposer))] public class prim : iprimitivedecomposer { public prim() : this(0) public prim(int val=0) {//some code } public bool match(node node) {return true;} } thx soko optional arguments in c# compile time "trick". constructor generated first code not have parameterless constructor. instead, has constructor takes 1 integer, , decorate

python - Why am I getting an "Unhashable type: 'list' " error? -

i have huge list ( mylist ) contains strings this: >>> mylist[0] 'akaka d hi -1 -1 1 1 1 -1 -1 1 1 1 1 1 1 1 -1 1 1 1 -1 1 1 1 1 1 -1 1 -1 -1 1 1 1 1 1 1 0 0 1 -1 -1 1 -1 1 -1 1 1 -1' now, want take 0, 1 , -1 , make list them, can make list name @ first part of string values of list of 0, 1 , -1... after time come monstrosity dictionary = {} x in range(len(mylist)-1): dictionary.update({mylist[x].split()[0],[]}),[mylist[0].split()[k] k in range(3,len(mylist[0].split()))]}) but when try out in commandline, error: >>> x in range(len(mylist)-1): ... dictionary.update({mylist[x].split()[0],[mylist[0].split()[k] k in range(3,len(mylist[0].split()))]}) ... traceback (most recent call last): file "<stdin>", line 2, in <module> typeerror: unhashable type: 'list' one way this: dictionary = {} x in mylist: p = x.find('1') if p > 0 , x[p-1] == '-': p -= 1 dictionary[x[0:p].str

java - Javascript placement in GWT HTML -

what difference of placing javascript (.js) library on before gwt application nocache.js , after nocache.js in gwt application uses js library in jsni methods. does affect wether jsni method functional or not? normal <script> tag blocking, gwt script tag not, since fetched asynchronously (i.e., non-blocking). onmoduleload() called when body has been parsed (i.e., scripts have been fetched). hence: put first script in list: save time; <script> tags loaded when onmoduleload() called. have @ here .

html - jQuery image sliding right not repeating instantly -

as can see.. repeat after full cycle of black background. find way make second actual image passes, start of image connected right @ end see no black while scrolling. ideas? html <body> <div id="wrapper"> <div id="header"> </div> </div> </body> css /* give header height , background image */ #header{ height:150px; background: #000 url(logo.jpg) repeat-y scroll left top; text-align:center; } js var scrollspeed = 50; // speed in milliseconds var step = 1; // how many pixels move per step var current = 0; // current pixel row var imageheight = 4300; // background image height var headerheight = 300; // how tall header is. //the pixel row start new loop var restartposition = -(imageheight - headerheight); function scrollbg(){ //go next pixel row. current -= step; //if @ end of image, go top. if (current == restartposit

ruby - Rails Iteration by month given range of dates -

i'm trying follow railscast , create morris.js line chart enquiry model. i've grouped counts using date_trunc months, i'm not quite sure @ how x-axis iterate on months (e.g jun 2012, jul 2013) opposed date in railscasts notes. i've tried range#step method here , graph displays 1 date (2012-07-01) without count , nothing else. commenting out .step(1.month) method range variable , graph works fine x-axis iterates date. class enquiry < activerecord::base def self.chart_data(start = 1.year.ago) total_count = total_count_by_month(start) start = start.to_date.beginning_of_month today = date.today.beginning_of_month range = (start..today).step(1.month) range.map |month| { created_at: month, total_enquiries: total_count[] || 0 } end end def self.total_count_by_month(start) enquiries = unscoped.where(created_at: start.beginning_of_month..time.now) enquiries = enquiries.group("da

html5 - How to enable a disabled button by clicking on another button? -

i have 2 buttons: <button onclick=initialize() id="1" data-role="button" data-mini="true" data-corners="false" data-theme="b">show position</button> <button onclick=calcroute() id="2" data-role="button" data-mini="true" data-corners="false" data-theme="b">evacuate !</button> i want have second button disabled default, , have enabled if clicking on first button. how accomplish this? please see following answers questions: disable buttons in jquery mobile how disable html button using javascript? the simplest approach (just pure example w/out taking consideration browsers, etc): <html> <head> <script> function enablebutton2() { document.getelementbyid("button2").disabled = false; } </script> </head> <body> <input type="button" id="button1

css - How to add a scrollbar to an HTML5 table? -

i have table in html5 add scrollbar to. want table show ten rows , user can scroll down see other songs. how can add scrollbar? here code table in html5: <table id="my_table" table border="5"> <tr> <th>url</th> </tr> <tr> <td>http://www.youtube.com/embed/evuspi2genw</td> </tr> <tr> <td>http://www.youtube.com/embed/evuspi2genw</td> </tr> </table> here css code: #my_table { border-radius: 20px; background-color: transparent; color: black; width: 500px; text-align: center; } if have heading table columns , don't want scroll headings solution you: this solution needs thead , tbody tags inside table element. table.tablesection { display: table; width: 100%; } table.tablesection thead, table.tablesection tbody { float: left; width: 100%; } table.tablesection tbody { overflow: auto; height: 1

livecode - How to create Screen sizes of Live Code application compatible to Iphone,Android All Screens -

i have developed app want run on every platform livecode supports.i have created app 480x800 size.now when test in iphone , android.app taking static size.so looks odd when testing under various sizes.how can make compatible sizes.that should there can automatically resize app screen size. we implementing resolution independence livecode , bring automatic scaling applications. in mean time, have use 1 of following options- 1) programmatically resize stack- http://forums.runrev.com/viewtopic.php?f=8&t=14859 2) use 1 of following 3rd party plugins- http://buchwald.ca/developer-tools/ http://mobgui.com/morph.php http://www.gadgetplugins.com/altplugins/altmobileresizer.rev

ember.js - Ember error when json response root key is singular -

i getting ember error when response json root singular. json response: {"subscription": {"id": "1"}} error: assertion failed: server returned hash key subscription have no mapping it model: app.subscription if pass plural root key subscriptions in json response, works fine. don't think should have though since singular version default behavior active _model_serializers if there 1 resource send. is bug in ember or should doing supported? what might define plurals on adapter. in case of model called app.subscription this: app.adapter = ds.restadapter.extend(); app.adapter.configure('plurals', { "subscription": "subscription" }); edit as .json 1 possible solution might hook buildurl function of restadapter , adding .json suffix yourself. this: app.adapter = ds.restadapter.extend({ buildurl: function(record, suffix) { var url = this._super(record, suffix); return url + "

Netty 4 difference between channel.close() vs channel.disconnect() -

i writing netty http client pooled connection, added pipeline.addlast("timeout", new readtimeouthandler(readtimeout)); while building channel pipeline. so in readtimeoutexception want close connection, without disturbing other connection in pool, doubt shall call channel.close() , channel.disconnect(), or channel.close() fine enough. thanks lot suggestions.

objective c - Mail function can't send to Recipients in iOS -

i created mail send function xcode. - (void)onsharebtn:(uibutton *)button { mfmailcomposeviewcontroller *picker = [[mfmailcomposeviewcontroller alloc] init]; picker.mailcomposedelegate = self; [picker setsubject:@"hello!"]; // set recipients. nsarray *torecipients = [nsarray arraywithobjects:@"first@gmail.com", nil]; nsarray *ccrecipients = [nsarray arraywithobjects:@"second@gmail.com", nil]; nsarray *bccrecipients = [nsarray arraywithobjects:@"third@gmail.com", nil]; [picker settorecipients:torecipients]; [picker setccrecipients:ccrecipients]; [picker setbccrecipients:bccrecipients]; [picker setmodaltransitionstyle:uimodaltransitionstylecrossdissolve]; // attach image email. nsstring *path = [[nsbundle mainbundle] pathforresource:@"share"

php include not working when switching to SSL -

i added ssl on site , and updated 'http://' 'https://' in absolute paths. i receiving error on relative php include though. code: include("connection.php"); error message warning: include(connection.php) [function.include]: failed open stream: no such file or directory in pathto/includes/index_header.php on line 57 i assuming need update "https" don't know where. i think u included index_header.php in index.php . ie. loads file root folder u needed add includes folder: index.php <- index_header.php <- connection.php you need do includes("includes/connection.php");

couldn't display json multiple objects with jquery -

i new jquery. but, want json multiple objects append html element. here first jquery code: <html> <head> <script type="text/javascript" src="jquery/jquery.js"></script> <script> $(document).ready(function(){ $.getjson("http://epomia.com/tmp/dc.php", function(data){ $.each(data, function(id, vall){ $.each(vall, function(x, y){ $("#mbuh").append(y); }); }); }); }); </script> </head> <body> <div id="mbuh"> </div> </body> </html> but, why doesn't want display json data ? wrong ? json in http://epomia.com/tmp/dc.php or code ? the json correct. the json link provided object 4 properties each of array. don't have iterate through array in order append each element. can call $.each(data, function (id, vall) { $("#mbuh").append(vall); }); see working fiddle

How to get size of zip files in a folder and save the name of file and size of zip file in excel -

i want create batch file gets size of zip files available in folder , save folder name appropriate file size in .csv file. used below command got 1 output because when loop ends last result fetched in .csv file for %%i in (*.txt) @echo %%~ni,%%i >c:\users\anoopn\desktop\out.csv i want result in format size in cell , whole path in different cell hope answer soon (for %%i in (*.zip) echo(%%~ni,%%~zi)>c:\users\anoopn\desktop\out.csv to folder's name calculated size of zip files use this: @echo off &setlocal /f "tokens=3" %%a in ('dir *.zip') ( call set "size=%%free%%" set "free=%%a" ) (echo(%cd%,%size%)>c:\users\anoopn\desktop\out.csv

android - ADT doesn't warn me about calling functions from the wrong API level -

i have android project minsdk 8 , targetsdk 17. used call function introduced in api level 9 ( camera.getnumberofcameras() ). adt doesn't seem mind , compiles fine no warnings. set targetsdk 8 well, , still builds fine no warnings. warn me if code isn't going run on sdk claim support. there way this? just change severity of newapi in android lint preferences error. properties --> android lint preferences --> newapi --> error in severity box make sure click refresh icon in lint warnings windows after every rebuild.

webforms - CustomValidator's ClientValidationFunction: is there a way to set trimmed value back to input? -

before validating trim arguments.value . if validation fails, want place trimmed value input. changing arguments.value not have effect. sender (the 1st argument in clientvalidationfunction ) validation control message layout, not original input. i see way: manual search input element id, or name, or class, makes clientvalidationfunction aware input, , have set clientid or unique class input. validator object passed val parameter of client validation function has controltovalidate field holds unique id of server control (specified in controltovalidate property of customvalidator ). can set value control following: function trimandsetback(val, args) { // val.controltovalidate hold unique id // of server control document.getelementbyid work validatorsetvalue(val.controltovalidate, validatortrim(eventargs.value)); } function validatorsetvalue(id, value) { var control; control = document.getelementbyid(id); if (typeof (control.value) == &q

c++ - How is returning an object by reference possible? -

i reading opencv tutorial , said following opencv's image holder class (cv::mat): the cv::mat class implements reference counting , shallow copy such when image assigned one, image data (that pixels) not copied, , both images point same memory block. applies images passed value or returned value. reference count kept such memory released when of references image destructed. i'm specficially interested in part says this applies images passed value or returned. how possible point same memory block when passed value? feel overloading = operator. says if image returned, returns image points same memory block , doesn't create new one. don't understand how implemented this. but here's understand: given pass value , returning image make new image share same memory block, makes sense implement reference counting. but explain how memory block shared, when object returned or passed value? this relatively easy: in class' constructor, allocate

sql server - WCF Service - return the output parameter from a stored procedure in Entity Model -

i have stored procedure authentication, taking login , password , returning string . call stored procedure(sql server 2005) wcf data service ( using entity model , function imports ) , return output parameter( string ) result . i using function import map stored procedure. how should proceed ? finally, got answer !! have use output parameter , give argument called stored procedure , type cast can use value . ( return format json equally valid xml format) interface : [operationcontract] [webinvoke(method = "get", bodystyle = webmessagebodystyle.wrapped, responseformat = webmessageformat.json, requestformat = webmessageformat.json, uritemplate = "authenticate/{login}/{pwd}")] implementation: public string authenticate(string login, string pwd) { steelcasemigrationentities entities = new steelcasemigrationentities(); system.data.objects.objectparameter output = new system.data.objects.objectparameter("out",

autohotkey not able to get Bing Desktop control -

the bing desktop has win + y hotkey toggle display of itself. want bring foreground win + hotkey. i met problem can't set focus search box controlfocus, edit1 edit1 classnn reported window spy. the script posted here: #i:: ifwinexist, ahk_exe bingdesktop.exe { ifwinnotexist, ahk_class bingtoolband { send #y return } winwait, ahk_class bingtoolband winactivate winwaitactive controlfocus, edit1 return } run "c:\program files (x86)\microsoft\bingdesktop\bingdesktop.exe" return i figured out ahk_class bingtoolband not top windowtitle of bing desktop. should have used 必应bing 缤纷桌面 instead.

NoMethodError in SessionsController#create in ruby on rails -

class sessionscontroller < applicationcontroller def create auth = request.env["omniauth.auth"] user = user.find_by_provider_and_uid(auth["provider"],auth["uid"]) || user.create_with_omniauth(auth) session[:user_id]=user.id redirect_to("/sessions/sign") end def sign end end this in user model class user < activerecord::base attr_accessible :name, :provider, :uid def self.create_with_omniauth(auth) create! |user| user.provider=auth["provider"] user.uid=auth["uid"] user.name=auth["user_info"]["name"] end end end error: undefined method '[]' nil:nilclass when sign in through facebook above error you need make sure following exists , not nil auth = request.env["omniauth.auth"] you do auth = request.env["omniauth.auth"] if auth # stuff else # error handler end

android - Gingerbread listview item animation issue -

i've looked issue nothing i've found matches situation. my problem occurs onandroid 2.3.x (on 4.x works perfectly) i have application custom list view. initialize listview follows listadapter mlistadapter = new listadapter(getapplicationcontext(), this, ...); lvselector = (listview) findviewbyid(r.id.listview1); lvselector.setadapter(mlistadapter); my listadapter follows: public class listadapter extends baseadapter { static class holder { linearlayout layoutroot, layoutcolor; textview htext; animation anim = animationutils.loadanimation(mactivity, r.anim.anim_list_item); public holder() { layoutroot = new linearlayout(mcontext); layoutcolor = new linearlayout(mcontext); htext = new textview(mcontext); } public holder(holder holder) { this.layoutroot = holder.layoutroot; this.layoutcolor = holder.layoutcolor; this.htext = holder.htext; } } int mswap1, mswap2; animation man

How to compare arraylist value and array value in java -

int sizeoftheshortestlist = webresult.size(); (int i=0; i<sizeoftheshortestlist; i++) { if (webresult1.get(i).equals(dbresult[i]) ) { system.out.println("equals..: " + webresult1.get(i)); } } from above code find errors please give solution compare arraylist values , array values take arraylist 'al'. take array 'a'. now u need compare 'al' , 'a'. iterator = new iterator(al); int length = a.size(); int count=0; for(int i=0;i<length; i++) { if(it.next()==a[i]); { count++; } } if(count == length) { system.out.println("both equal"); } else { system.out.println("both not equal"); }

cocoa - NSFormCell placeholderString -

just set nsform , binded first row nsformcell in interface builder. when enter text, expected result in [myformcell placeholderstring] or [myformcell placeholderattributedstring] there nil. instead, [myformcell stringvalue]. what's purpose of placeholderstring? doing right? the placeholder string used when user has not entered yet. can instruct user enter without needing separate label.

c# - Programmatically create/destroy network bridges with .NET on Windows 7 -

i trying programmatically create , destroy network bridge on windows 7. technologically love stay within .net 4 realm (pinvokes fine, ofc), utilizing c++ option. research far turned configuration, netsh -commands the route go . however, there seems no option spin new bridge them. investigating this program uses inetcfg apis, appears program or, more specifically, apis, not able (again) build new bridge. if can contribute solving problem, kind of appreciated. [update:] seems newtork bridges implemented using driver binds both devices. cannot yet make of information, still appreciated. i've found solution works both bridge service , bridge adapter driver. don't use updatedriverforplugandplaydevices devcon i'm using diinstalldevice instead. however, installing drivers first time in non interactive mode (without user interaction) not possible. because there no corresponding .cat files builtin bridge .inf files. neither updatedriverforplugandplaydevi

JSP upload File failed -

i going build simple jspfile handle upload files using servlet. when comes execution, shows following message demo fail: org.apache.catalina.connector.requestfacade cannot cast org.apache.tomcat.util.http.fileupload.requestcontext would please tell me how convert http request requestcontext ? the below code jsp front-page <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title test upload</title> </head> <body> <form action="uploadfile" method="post" enctype="multipart/form-data"> <input type="file" name="file" /> <input ty

vim plugin - Using repeat.vim for keymapping -

i'm trying set custom keymapping debug-stepping gdb , pyclewn , this: nnoremap <leader>ds :cstep<cr> now when pressing . i'd repeated, since stepping i'm going often. found repeat.vim , a helpful answer , tried this: nnoremap <silent> <plug>ccstep :cstep <bar> silent! call repeat#set("\<plug>ccstep", v:count)<cr> nmap <leader>ds <plug>ccstep i tried using :cstep<cr>:silent [...] instead of :cstep <bar> silent seperate 2 commands. both variants don't seem work. either blinking screen (bell) when pressing . or random happens, chars getting deleted. what doing wrong?

css - Two DIVs inside DIV. How to auto-fill the space of parent DIV by second DIV? -

please visit this fiddle see mean - i have parent div, within there 2 divs placed in vertical order. top div should have height of content, whereas bottom div should occupy remain space of parent div irrespective content heights, , shouldn't overlap parent div. html: <div class="outer"> <div class="inner-title"> title </div> <div class="inner-content"> content area </div> </div> css: html,body { height: 100%; } .outer { background-color:blue; height: 80%; } .inner-title { background-color:red; } .inner-content { background-color:yellow; height: auto; } in short, "inner-content" should occupy remaining space of "outer" div, without overlapping. any idea of how achieve this? any on appreciated. add display:table; parent div , display:table-row; child divs and height:0 first child div. takes auto height htm

Laguage support in creating json from php -

i json in korean. language of aap english. problem replace korean language ????? . code snippet is: <?php $mysqli = new mysqli ( '50.62.209.85:3306', 'local', 'root123', 'android'); // check if album id posted parameter $myq = $mysqli ->query ( 'select id, url, name hollywoodmovies' ); while ( $myr = $myq->fetch_assoc () ) { $array["items"][] = (array( 'id' => $myr['id'], 'id' => $myr['url'], 'title' => $myr['name'], )); } echo json_encode($array); ?> json_encode documentation string json_encode ( mixed $value [, int $options = 0 [, int $depth = 512 ]] ) for paramater value: all string data must utf-8 encoded check if data encoded in utf-8

function - PHP get last occurrence between range (strrpos) -

how last occurrence of symbol between range ? strrpos($text, '.', 100) gives me last occurrence starting 100 end but how last occurrence between range, like: strrpos($text, '.', 100-250) ? this work: strrpos(substr($text', 100, 250), '.');

javascript - invoke function wrapped inside of anonymous function -

to avoid variable collision , "everything" javascript experts should use self invoking function 1 below. how can reference outside. or example how can invoke foo function inside it? onclick="foo()" // doesn't work outside !!! <div style="width: 500px; height: 500px; background: red;" id="dfg" onclick="foo()"></div> <script> (function () { function foo(){ console.log("everything ok") } }()); </script> well can add method window object. (function (global) { global.foo = function(){ console.log("everything ok") } }(window)); foo(); // ok demo

c# - What does the @model keyword do in an ASP.NET MVC View? -

i have doubts how work @model statement cshtml view. in code, have this: @model mycorp.earlywarnings.webinterface.models.homepagemodel so do? i think including homepagemodel model current view object instance of class contains information have show in view, interpretration correct or missing something? another doubt is: populate model? populated specific controller of view? i think including homepagemodel model current view object instance of class contains information have show in view, interpretration correct or missing something? yes, have interpretted correctlty. is populated specific controller of view? yes, populated specific action of specific controller view.

java - ArrayList conversion to Instances object -

i ve got arraylist testset. list contains data smo evaluation in weka. want use evaluation weka class in order classify testset. in simpliest case, had features extracted 1 image in arraylist. conversion must done in order use list in following: evaluation eval = new evaluation(testset); // how can cast testset2 instances object? eval.evaluatemodelonce(c, data); this code found here : using in order train smo model. train dataset contains feature extracted train images, stored in .arff file. in test process reading in code image calculate features, stored them in arraylist without stored them in .arff files. want cast list directly instances object , proceed classification. edit: ve tried else, first connvert arraylist array double data , proceed proceed trainset: int numatts = data[0].length; fastvector atts = new fastvector(numatts); (int att = 0; att < numatts; att++) { atts.addelement(new attribute("attribute" + att, att)); } int numinstances = data.le

owl - Compare Data Property values using Protege and Fact++ -

using protege i'm trying compare string values data properties. e.g.: i have country class, , in class have individual hascountryname data property set "england". i'm using defined class, , want like: country , (hascountryname value "england") using hermit reasoner, correctly infers individual member of class, using fact++ not. i'd use fact++ reasoner, there way can modify fact++ recognises it? fact++ , hermit supposed support same inferences, if works 1 not other suspect bug. confirm this, can try same example using like country , (hascountry value england) where hascountry object property. not make sense in terms of original ontology, same inference should kicked off without using data properties , literals. if fact++ recognizes this, there bug in how works literals , datatype properties.

asp.net - Amazon EC2 Windows: Should I have separate instances for my IIS and SQL Server? -

i have website (asp.net web application) hosted on iis on amazon ec2 "windows sql standard" instance, sql server on same instance well. i wondering if better (strictly performance wise, i.e. site faster user) separate them 2 instances, 1 web application on iis, , 1 sql server. the application uses entity framework 4 access , read/write database. workload wise, expecting there 1000 records (e.g. record customer, each orders, details, history, budget, payments, etc...) getting created daily. server has 15gb memory, intel xeon cpu 2 @ 1.8gz. standing idle, sqlserver.exe using 300mb memory, , w3wp using 600mb memory. on single request, e.g. login, cpu usage sqlserver.exe goes 10%, , same w3wp.exe. i know there lot of other details need go making such decision, not looking yes/no answer, hoping more considerations, past experiences, pros/cons, things think make better decision, , of course recommendations. generally speaking, yes. consensus separate box each,

c# - How to call function 200 times in 1 second -

this code doesn't call function 200 times in 1 second, first time 167 calls, second time 201 don't 200. public thread thread; public timer timer; int = 0; private void button_click(object sender, routedeventargs e) { timer = new timer(mess); timer.change(10000, 10000); thread = new thread(calc); thread.start(); } private void mess(object state) { messagebox.show("call in on second : " + (i / 10).tostring()); = 0; } private void calc(object obj) { while (true) { i++; thread.sleep(5); } } its because of scheduler wich manage different threads in processor. process not running time in processor strange behaviors can occur. programs using threads deterministic (it's why 167 first time ans 201 in second time)

vba - Replace function converts text format to number format. Is it excel bug? -

i'm not newbie in excel or googling, behavior surprising/illogical: format column "a" text write numbers cells, e.g. 74 a1, a2 , a3 - formatted text, not sum up, looks fine expected go find - replace 74 75 after replace 75's sum up, behaving numbers, when cells still formatted text! can't why?! this "bug" (?) causing me troubles in vba, because following code not convert data expected results ('numbers' in text format) , can't text format: selection.replace what:="74", replacement:="75" same result when try of these methods: selection.replace what:="74", replacement:=format("75", "@") selection.replace what:="74", replacement:=cstr("75") selection.replace what:="74", replacement:="75" selection.numberformat = "@" only solution works this: selection.replace what:="74", replacement:="'75" but don

c - relating UART driver with character driver -

i have written simple character driver.now want write uart driver omap 4460 processor. in way should start ie how should relate character driver? i dont know start.i have gone through manual of processor , know functionality of driver.please provide me steps

javascript - Align a floating component to the top right of a container with ExtJS -

i have floating component (a panel), want align top-right corner of container. for moment, i'm able align top-left corner component have listener : listeners: { afterrender: function() { this.setposition(0,0) }, } problem, container component should align width has undefined size has may resize according screen resolution. how can manage ? i've checked alignto method can't make work ! any idea ? same bottom-left corner ! i can provide more codes if needed. thanks. you can use alignto method follows; listeners: { afterrender: function(cmp, eopts) { cmp.alignto(ext.getbody(), 'tl-tl'); } } that should it, bottom right alignment use 'br-br'. if want address screen resizing, put listener on viewport resize event , re-run alignto on component.

java - unable to hit the webservice using soapUI after proxy setting -

due change in server configuration, in project. apt proxy server while calling webservice axis2. problem, here cannot able access the endpoint through soapui(after configuring proxy configuration in preference->proxy setting) can access endpoint through eclipse code after configuring proxy. here exception getting in soapui logs fri mar 21 19:09:51 ist 2014:error:java.lang.classcastexception: org.apache.http.message.basichttprequest cannot cast org.apache.http.impl.client.requestwrapper java.lang.classcastexception: org.apache.http.message.basichttprequest cannot cast org.apache.http.impl.client.requestwrapper @ com.eviware.soapui.impl.wsdl.support.http.headderrequestinterceptor.process(headderrequestinterceptor.java:42) @ org.apache.http.protocol.immutablehttpprocessor.process(immutablehttpprocessor.java:108) @ org.apache.http.protocol.httprequestexecutor.preprocess(httprequestexecutor.java:174) @ com.eviware.soapui.impl.wsdl.support.http.httpclientsupport$soapuihttprequestexe

timepicker - Get Current DateTime C# without hour -

hi have timepicker. returns object timespan. need set datetimeoffset equal current date plus timespan timepicker. how can current datetimeoffset.now doesn't have time on it, date can add offset it. thanks as in datetime object have date property, returns date part without time (it means time 00:00:00). datetime today = datetimeoffset.now.date; datetime result = today + yourtimespan; with solution lost offset information (because date datetime ). keep need subtract time part: datetimeoffset = datetimeoffset.now; datetimeoffset result = - now.time + yourtimespan; or constructor: datetimeoffset = datetimeoffset.now; datetimeoffset result = new datetimeoffset(now.date + yourtimespan, now.offset);

c# - decimal.Parse method -

i found weird bug in c# code, so there next: when i´m trying cast object{string} decimal : item.valiafundo = row.isnull("pl_fundo") ? 0 : decimal.parse(row["pl_fundo"].tostring()); with value of row = "2488.1987", returns me 2488.1987 supposed, users returned value 24881987. i fixed changing type of object database return object{decimal}, : item.valiafundo = row.isnull("pl_fundo") ? 0 : (decimal)row["pl_fundo"]; that casts value user, , want understand why bug happens? cause it? have ideas? p.s.: server , users regional settings same both cases. but, seems data coming server decimal in type. it bad practice go decimal --> string --> decimal. as jon skeet pointed out (his answer disappeared) in cultures comma decimal point. when doing tostring() careful culture used.

linux - PHP script stops execution in 5 min -

i running php script terminal stops execution in 5 minutes. max_execution_time value in ini 600. and have added set_time_limit(0) @ top of script then ends in 5 minutes. same happens when running browser also see if values overwritten phpinfo() after max_execution_time , set_time_limit(0)

mysql - how to count the two count function's return value in once sql query -

i have 3 tables a,b,c.their relation a.id b's foreign key , b.id c's foreign key.i need sum value when b.id = c.id , a.id = b.id ,i can count number query twice. need way count summation once time ! my inefficient solution select count(c.id) c,b c.id = b.id; //return value x select count(a.id) c,b a.id = b.id; //return value y select x + y; // count summation fo x , y how can optimize ? thks! :) ps: my question galaxql ,which sql interactive tutorial.i have abstract problem,more detail can check section 17.select...group by... having... you can these things in 1 query. instance, this: select (select count(*) c join b on c.id = b.id) + (select count(*) c join on c.id = a.id) (your second query not parse because a not recognized table alias.) in case, if learning sql, first thing should learn modern join syntax. implicit joins using out of date 15 years ago , have been part of ansi standard on 20 years. learn proper join syntax.

java - Best way to initialize three dimension List -

is there better way allows me initialize three-dimensional arraylist? list<list<list<string>>> lista = new arraylist<list<list<string>>>(3); (int i=0;i<3;i++){ list<list<string>> lista2 = new arraylist<list<string>>(4); (int j=0;j<4;j++)lista2.add(new arraylist<string>(5)); lista.add(lista2); } without external libraries or introducing new classes -- can use double brace initialization . bit cleaner having intermediate variables. public list<list<list<string>>> lista = new arraylist<list<list<string>>>(){{ for(int i=0;i<3;i++) add(new arraylist<list<string>>(){{ for(int i=0;i<4;i++) add(new arraylist<>(5)); }}); }};

c++ - Qt Creator autocomplete: Enable mid-string matching -

Image
qt creator has autocomplete/intellisense feature, matches identifiers strictly start have typed: for example, if have member called ui->label_4 , , start typing ui->label , listed, if try typing ui->_4 or ui->l_4 , not, because though _4 part of identifier, not start it. example: is there way enable mid-string matching in qt creator autocomplete? looked everywhere in options couldn't find anything. my current version qt creator 2.8.1 i'm getting mid-string matching behavior default in qt creator 3.0. don't recall ever seeing behavior in prior versions of qt creator.

resources - Restlet : why can't I get the POSTed XML content? -

i'm using restlet provide rest services through api. until now, available resources have been accepting content in form of key,value pairs. i'm extend resources may accept xml instead. however, can't work. when post requests xml content, request#getentity() doesn't seem have idea of posted content. i've tried wrap entity in domrepresentation , doesn't either. also, when invoke request#getentity().gettext() null . what need in order service accept xml? i've added org.restlet.ext.xml classpath...do need declare in way? furthermore, there other dependencies somehow need take care of manually? try using s stringrepresentation. see this: http://l46kok.blogspot.co.il/2013/06/restlet-how-to-post-xml-data-from-client.html

How to write dropdown menu for currentuser -

i'm noob in ror world , need help. question this: i've form <div class="form-container"> <%= form_for([@modulo2.user, @modulo2]) |f| %> .......... <div class="form-field"> <h3> modulo1: </h3><br/> <%= f.select(:modulo1_id, modulo1.all.map{|p| [p.nome_progetto]}, :prompt => "seleziona il modulo1 associato") %> </div> </div><br/> the result dropdown menu modulo1s need ones current_user. can try??? in adding, when select 1 item dropdown menu have no association values in table. sorry question can't find answers searching. i found solution: <%= f.select(:modulo1_id, current_user.modulo1s.all.map{|p| [p.nome_progetto,p.id]}, :prompt => "seleziona il modulo1 associato") %> i've 1 dou

php - Enable function auto-complete in Aptana Studio for returned objects -

i'm using eclipse plugin of aptana studio , i've set primary project nature php. reason there no auto complete suggestions returned objects. example: $db = new pdo(...); $db->... //auto complete suggestions listed $var = $db->prepare(...); //returns pdostatement $var->... //no auto complete suggestions is possible enable auto complete suggestions returned objects?

c++ - Returning a pointer to the youngest student in a dynamic array -

i trying write function iterate through dynamic array holds students records in format: name id age once function finds youngest age, return pointer main function , output it. the problem function of type student, structure; , formatted so: struct student{ string name; string id; int age; }; i struggling return pointer (ptr) , output console, outputting (what think) memory location... here code far, any advice helpful. the structure: struct student{ string name; string id; int age; }; the function call: cout << "youngest: " << youngest(student_dynamic, sizeof) << endl; and function: student* youngest(student* s, int size) { int tempage = 0; int youngestage = 100; student *pt = new student; (int = 0;i < size;i++) { tempage = (s+i)->age; if (tempage < youngestage) { youngestage = tempage; pt->age = youngestage; } }

html - Bootstrap Horizontal Scrollable Table -

i have been struggling while now. have table in bootstrap if gets wide make scrollable can @ least scroll see information. my html pretty simple table within box <div class='box'> <div class='box-header'> <h4>title</h4> </div> <div class='box-content'> <table> <!--table stuff--> </table> </div> </div> and have tries usual of setting width , overflow-x:scroll; so table{ width:100px; max-width:100px; overflow-x:scroll; } but nothing seems work. i have jsfiddle set here. http://jsfiddle.net/ahyuf/3/ any much, appreciated! put max width overflow on tablescroll div (container) instead... .tablescroll{ width:200px; max-width:200px; overflow-x:scroll; }

oraclereports - Setting session based NLS_NUMERIC_CHARACTERS in Oracle Reports -

i'm trying create report can switch between english , (canadian) french number formatting (1,234.56 vs 1 234,56) having troubles. before have tried i'd in past have converted french number character, , made appropriate string modifications there, isn't best solution , i'm trying find better going forward. the first thing tried doing adding following line before report trigger in oracle report itself: srw.do_sql ('alter session set nls_numeric_characters = '', '''); i have number fields set format mask "(nnngnnngnn0d00)" assume g's , d use session's nls_numeric_characters setting don't seem to. to see if setting changing created following query in report , displayed it's output: select value nls_session_parameters parameter = 'nls_numeric_characters'; sure enough output changed '.,' ', ' using alter session command. after researching more online read change needs made in oracle

xslt - Loading XML using a HTTP GET request in classic ASP -

i'm working on old software written in classic asp (vbscript). i should create asp page makes xsl transformation. i'm able using static files have work xml files dynamically generated asp pages (this doesn't work). this code: dim document, stylesheet, o set document = server.createobject("msxml2.domdocument") document.async = false set o = createobject("msxml2.xmlhttp") o.open "get", "http://localhost/aaa/cgi-bin/fo/file.asp?id_x=39", false o.send 'document.load server.mappath("test.xml") ' <- static file working 'document.loadxml(o.responsetext) ' <- not working document.load o.responsexml ' <- not working set stylesheet = server.createobject("msxml2.domdocument") stylesheet.async = false stylesheet.load server.mappath("test.xslt") 'response.write o.responsetext ' <- working! (return correct xml) 'response.write o.responsexml.xml ' <- not w

c++ - "Declaration does not declare anything" and "expected unqualified-id" -

compiling code in visual studio totally fine. bool check(void); bool check(void) { return true; } but in xcode(apple llvm) warning on declaration declaration not declare and error on definition parse error: expected unqualified-id what going on here? how can fix this? iirc on mac there exists macro "check" interfere function name. try mycheck.

Multiple pages in Eclipse android application -

i new in space working mini app. have animal images in main template , want when click example dog image must switch page , there dog description , image gallery. need know how create multiple pages , redirect it. app. ... @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); //////////////////////// dog button button3 = (button)this.findviewbyid(r.id.button3); final mediaplayer dog = mediaplayer.create(this, r.raw.dog); button3.setonclicklistener(new onclicklistener(){ public void onclick(view v) { // if music playing if(dog.isplaying() == true) // pause music player dog.pause(); // if it's not playing else // resume music player dog.start(); } }); you must create differents activity different pages. , use intent change page.

plsql - Performing select operations with a cursor inside a caught exception -

i'm trying write stored procedure takes input of id searches 3 different tables item using different criteria. 1 solution have perform select statement on each table 1 one, , catching no_data_found exception if nothing found via select . in pseudocode: select item from first table if no data found, throw exception. handle exception selecting data second table if no data found, throw exception. handle exception selecting data third table (if data not present in row should return 0 rows) here's have: open request select req_type, req_type_status tableone tableone.req_id = requestid , (req_status = 'd' or req_status = 'a'); exception when no_data_found begin open request select req_type, '-' req_type_status tabletwo tabletwo.req_id = requestid; exception when no_data_found

java - Serializing List<Item> to JSON with custom fields -

i'm trying create simple rest api spring mvc, returns data in json format. i'm working on method returns list of authors, that's accessed example.com/api/authors?find=somename i have jpa entity called authors. have @service fetches list<author> collection. author entity has properties, id, firstname, lastname, birthdate . what i'm trying achieve json result like: { "data": [ { "id": 1, "name": "leo tolstoi", "age": 49 }, { "id": 2, "name": "billy shakespeare", "age": 32 } ] } as can see, result has 2 fields not directly entity, rather should generated author entity's values. name field author.getfirstname() + " " + author.getlastname() , age someutilityclass.calcage(author.getbirthdate()) i'm trying figure out how sort of out