Posts

Showing posts from May, 2013

vb.net - Grouping and Joining a Unioned Table. Having Problems -

the other day asked question , received helpful information assisted me far. having trouble taking data tables using union/group by. the following code have tried. cannot seem find way make group player. it showing this. jono - 3 - 1 jono - 1 - 1 when need show this jono - 4 - 1 i beginning if there better way perform code, please tell me :) select [player],[played],[games won] (select p1.displayname [player], count(p1.displayname) [played], sum(iif(m.player2=m.winner, 1, 0)) [games won] ((tblmatch m) inner join tblplayers p1 on m.player2=p1.id) m.season = 3 group p1.displayname union select p2.displayname [player2], count(p2.displayname) [played], sum(iif(m.player1=m.winner, 1, 0)) [games won] ((tblmatch m) inner join tblplayers p2 on m.player1=p2.id) m.season = 3 group p2.displayname) my database layout is: tblplayers (id,firstname,lastname,displayname,handicap,current) tblseason (id,season) tblmatch (id,matchdate,season,player1,player2,player1score,pla...

java - Error When Comparing Objects of Type Double? -

this question comes after piece of code (an implementation of binary search). appreciate if tell me why not outputting expected answer: public static void main(string[] args){ double[] array = {0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0}; binarysearch s = new binarysearch(array); system.out.println(s.searchnexthighest(2.0)); } public binarysearch(double[] array){ numbers = array; } public integer searchnexthighest(double y){ return binarysearchnexthighest(0, numbers.length-1, y, numbers); } public integer binarysearchnexthighest(int min, int max, double target, double[] array){ int mid = (min+max)/2; if(target==array[mid]){ //fails here return mid; } if(max<min){ if(min>=array.length) return null; return mid; } if(target>array[mid]){ return binarysearchnexthighest(mid+1, max, target, array); }else{ return binarysearchnexthighest(min, mid-1, target, array); } } output: 1 ...

php - wordpress get_excerpt() in loop -

update: found work around, listed below. new wordpress of today. can't seem "the_excerpt" in loop. either not show or posts on first one. ideas? it's towards bottom trying insert it. <? if(!$_get[id]) { $args = array( 'numberposts' => '5' ); $recent_posts = wp_get_recent_posts( $args ); start_wp(); foreach( $recent_posts $recent ) { set_post_thumbnail_size( 33, 33); $excerpt = get_the_excerpt(); { ?> <table width="100%" cellpadding="0" cellspacing="0" id="blogholder"> <tr> <td width="21%" rowspan="2" align="center" valign="middle"><div class="blogimage"><? echo get_the_post_thumbnail($recent["id"], array(133,133) ); ?></div> <img src="images/blogimagebox.png" width="177" height="177" /></td> ...

sql - ERROR 1148: The used command is not allowed with this MySQL version -

i trying load data mysql database using load data local infile a.txt db lines terminated '|'; the topic of question response get. understand local data offloading off default , have enable using command local-infile=1 not know place command. you can specify additional option when setting client connection: mysql -u myuser -p --local-infile somedatabase this because feature opens security hole. have enable manually in case want use it.

vbscript - Execute/Call a script file from inside of an imacro file -

i have visual basic script file needs called in imacro file. possible? if yes, please provide example ! badly in search of answer :( thanks in advance !! :) :) from gleaned documentation doesn't seem possible. can run imacros code vbscript, , can run javascript code macro via eval , cannot run external vbscripts imacros .

angularjs - How to call an angular resource from a service -

i using angular 1.1.5 (wait angular-ui-router comptabible 1.2.0). defined resource , service: myapp.factory( 'monitoring', function($resource) { return $resource('/webapp/network/v1/cronjobs/:id/:action', { id: '@id' }, { status: { method: 'patch', headers:{'content-type': 'application/json'}, params:{action: 'status'}} } ); }); myapp.factory('monitoringcrudcontrollerservice', ['monitoring', '$state', function(monitoring, $state) { return { query: function() { var m = new monitoring(); var promise = m.$query().then(function(response) { console.log(response); return response.data; }); return promise; }, query1: function() { var m = new monitoring(); return m.$query(); }, // angular 1.2.0 rc query2: function() { var m = ne...

php - How to split text by html tags using preg_split? -

i have problem splitting text html tags. i'm using ckeditor editing text , saving results database. better understanding problem i'm putting sample text db string(3351) "<p> etiam @ auctor massa. in eget turpis leo auctor molestie. fusce luctus felis ac porttitor tempor. etiam est magna, convallis consectetur eget, fermentum ac risus. etiam ut dapibus eros. ut non erat et enim scelerisque fermentum. praesent cursus sollicitudin pulvinar. cras faucibus mauris eget velit elementum gravida. vestibulum vel leo ut justo pretium gravida non ligula. aliquam imperdiet metus ut odio varius viverra et @ augue.</p> <div style="page-break-after: always;"><span style="display: none;">&#160;</span></div> <p> aenean aliquet rutrum fringilla. pellentesque non ultrices erat, non luctus lectus. pellentesque eget neque eget augue imperdiet venenatis eu nec odio. nulla suscipit enim et nunc consequat, sed venenati...

get div id when an object is dropped using jquery -

i want div id of dragged item when dropped div. problem , when drop layer 3, reads layer 1 , layer 2. want layer 3 since hovered. please consider code below. thanks in advance. <div> <img class="item" src="img.jpg"/> </div> <div id="layer1" class="droppable" style="width:100px; height : 100px ;"> <div id="layer2" class="droppable" style="width:70px; height : 70px; "> <div id="layer3" class="droppable" style="width:50px; height: 50px"> drop image here </div> </div> </div> <script> $(function(){ $(".droppable").droppable({ accept : 'item' , drop : calldropp }); function calldropp (){ <!-- here --> } }) </script> try using event.stoppropagation : $(function(){ $(".droppable").droppable({ accept : 'item' , drop : ...

javascript - JQuery to make div customized scroll bar always visible -

Image
i have table content marked div height of 200px. table content user input & dynamic . using jquery modulate scroll bar if use overflow-y: scroll !important; normal scroll appears @ beginning.. if div content crosses 200px height jquery scroll bar appears along normal scroll bar. what want : want show jquery scroll bar visible irrespective of div height not normal scroll bar shown in below image. error snapshot: css: <style type="text/css"> #boxscroll { height: 200px; width: 230px; overflow-y: scroll !important; } </style> jquery: <script src="js/jquery.min.js"></script> <script src="js/jquery.nicescroll.min.js"></script> download jquery here... https://jquery-nicescroll.googlecode.com/files/jquery.nicescroll.340.zip <script> $(document).ready(function() { var nicesx = $("#boxscroll").nicescroll({touchbehavior:false,cursorcolor:"#ccc...

android - Send data to a parent activity onBackPressed -

this question has answer here: setresult not work when button pressed 10 answers is there way send updated data parent activity when pressed? i'd update data in bundle, don't see how access it. for example, have gallery activity opens image viewer. user scrolls through dozen images , backs out gallery. ideal update focal image in gallery last image viewed. at moment can't think of how without global setting. here's pseudo code of i'd (although wouldn't work): child: @override public void onbackpressed() { getintent().setdata(currentimage); // not right intent, super.onbackpressed(); } parent: @override public void onresume() { super.onresume(); uri photofocus = getintent().getdata(); if (photofocus != null) setphotofocus(photofocus); } you can startactivityforresult() from parent a...

php - How could i show only one digit after floating point -

$f = sprintf ("%.1f",$per); echo "you hit".$f." by code can show 1 digit after floating point.but when result 100%,then shows 100.0%. want show 100%. how this???? $per = 100; $f = sprintf ("%.1f",$per); $rounded = round($f, 1); echo $rounded;

c# - Select count from datatable against dynamic query -

i have data set in memory has 2 data tables in it. cont ins secondly have separate data table (in memory) in have rows in following format. and suppose has 2 rows. in actual may have million of rows id tablename columnname operator value 1 const id = 1 2 ins app_id = 558877 as is : information given rows , construct query , execute in database server like: select count(*) cont.id= 1 , ins.app_id = 558877; on basis of above query result have implemented business logic. objective: in order increase performance want execute query in application server have complete table in memory. how can it. note : tables name may vary according data. do want keep tables millions of rows in memory? in terms of counting in memory table, how kept? if it's datatable per tag can use datatable.rows.count property. if table names aren't known, can loop on tables in dataset.tables , c...

cordova - phonegap: MainActivity.java - changing extends to "Droidgap" causes errors -

Image
i'm trying set phonegap 3 days now. docs me "phonegap add android" part returns error tried tutorial adobe http://www.adobe.com/devnet/html5/articles/getting-started-with-phonegap-in-eclipse-for-android.html this part: change base class activity droidgap ; in class definition following word extends : public class mainactivity extends droidgap { will cause 2 errors. 1 resolved changing protected public on function. the error can't resolve one: "the method getsupportfragmentmanager undefined mainactivity". the whole process of setting phonegap frustrating, very, appreciated. "the method getsupportfragmentmanager undefined mainactivity". getsupportfragmentmanager() public method in fragmentactivity class. mainactivity have extend fragmentactivity in order work. shouldn't necessary have code if trying follow "getting started phonegap in eclipse android" tutorial. when create android project, double-c...

android - GCM clarifications -

i know these methods deprecated, since new gcm api seems buggy, reverting these methods until stable version pushed google. we declaring receiver inside manifest. <receiver android:name="com.google.android.gcm.gcmbroadcastreceiver" android:permission="com.google.android.c2dm.permission.send" > <intent-filter> <!-- receives actual messages. --> <action android:name="com.google.android.c2dm.intent.receive" /> <!-- receives registration id. --> <action android:name="com.google.android.c2dm.intent.registration" /> <category android:name="com.myapp" /> </intent-filter> </receiver> <service android:name=".gcmintentservice" /> and have onmessage() method inside gcmintentservice class. @override protected void onmessage(context context, intent intent) { ...

How to keep track of webpages opened in web-browser using Python? -

i want write python script can keep track of webpages have been opened in webbrowser(mozilla firefox 23). don't know start. standard webbrowser module of python allows webpages opened standard documentation doesn't have interacting webpage. so need write plugin browser can send data python script missing functionality standard library? i have looked @ related questions this simulating web-browser in python using mechanize and/or selenium. don't want that. want data webbrowser in using standard python libraries. edit just add more clarity question, want keep track of current webpages open in firefox. this answer may bit fuzzy -- because question not extremely specific. if understand well, want examine history of visited pages. problem is not directly related html, nor http protocol, nor web services. history (that can observe in firefox when pressing ctrl-h) tool implemented in firefox , such, implementation dependent. there can no standard library...

performance - Render The Same Model Multiple Times -

Image
what i'm trying do, having 1 model gets rendered multiple times, different translations , rotations. so know how use array buffers , array element buffers ( vertex buffer objects ), question is. when i've loaded model vbo best approach if wanted render multiple times different translations , rotations. i have 2 theories how done. (though i'm asking best approach). load model 1 vbo , keep calling gldrawarrays , apply translation , rotation, each model want rendered. load model 1 vbo multiple times. same model gets stored multiple times, which ends using lot of memory. extra: when doing 1 way, quadtrees and/or frustum can used minimize amount of models required rendered. which 1 of these ways best do, if want high fps , still save amount of memory possible, or there approach better? just clarify i'm not asking how render using vbo's or how render in general, i'm asking best approach when want render same model multiple times. test mod...

python - How to select last element of a for loop? -

f = open("unknown.txt", 'r') = sum(line.count('ly') line in f) f = open("unknown.txt", 'r') words = 0 line in f: words += len(line.split()) print(words) so code outputs numbers leading 78, amount of words in text file, how '78' , '78'? can use itself, in advance! for line in f: words += len(line.split()) print(words) this prints total number of words after every line in file. if want print amount of words after python has calculated how many there are, de-indent print call: for line in f: words += len(line.split()) print(words)

CentOS, sendmail no corresponding with PHP -

i have got trouble sendmail functionnality on centos (v6.) server. no issue mail sent through command lines stays impossible through php webpages. does have idea problem? have configured sendmail functionnality, have configure else? (php service?) (started comment it's getting bit long) you've provided no details of attempt resolve yourself. have tried? it helpful if provided output of: <?php $mc=ini_get('sendmail_path'); print "config: $mc <br />\n"; $p=explode(' ', $mc); if ($p[0]) { passthru("ls -l " . $p[0]); } else { print "no mua\n"; } print "<br />\n"; print "running " . posix_getlogin() . "\n<br />";

matlab - Gesture recognition using hidden markov model -

i working on gesture recognition application, using hidden markov model classification stage on matlab(using webcam). i've completed pre-processing part includes extraction of feature vector. i've applied principal component analysis(pca) these vectors. now me use kevin murphy's hmm toolbox, need observation sequence in form of numbers(integers) ranging 1 m (m = number of observation symbols). if i'm correct have use concept of codebook , use vector quantization observation sequence. my questions: how build codebook? and how use codebook obtain observation symbols of input video? note: i've used elliptical fourier descriptors shape feature extraction , each gesture pca values stored in matrix of dimension [11x220] (number of frames in video = 11) what do next? there other way obtain feature vectors instead of elliptical fourier descriptors? an hmm family of probabilistic models sequential data in assume data generated discrete-state markov ...

c# - #if debug --> #if myOwnConfig? -

is there way in c# use custom configuration "#if debug" i need "#if offline" build-config's name "offline" (only further debug-purposes too)... thanks! build -> configuration manager -> active solution configuration -> new... create new configuration "offline". project -> properties -> build -> configuration -> offline conditional compilation symbols: type offline save project.

jquery - Jqueryui tab - How to change conner to square conner -

Image
how change conner square conner i don't want conner have radius i want square like here code http://jsfiddle.net/squsn/ .ui-tabs { border:none; } .ui-widget-header { border:none; background: #fff; } .ui-tabs .ui-tabs-panel { display: block; clear: both; border: 2px #ccc solid; padding: 10px; width:auto; } i try follow tut http://kyleschaeffer.com/development/simple-jquery-tabs-template/ . not running. how thanks see working fiddle basically, add following 2 css rules: .ui-corner-top { border-radius:0px; } .ui-corner-bottom { border-radius:0px; } make sure include them after jquery ui stylesheet rules cascade properly. cheers.

sql - Trying to get a third normal form -

i edited question make more understandable: i got tiny problem , don't know how handle it. lets got table following attributes , values want transform third nf. table created automatically machine: keyid | action | class | method | storenr. | country 1 | action1 | class1 | method1 | 123 | gb 1 | action2 | class2 | method2 | 123 | gb 2 | action5 | class5 | method5 | 335 | null 2 | action8 | class8 | method8 | 335 | null 3 | action2 | class2 | method2 | null| nl 3 | action5 | class5 | method5 | null| nl 4 | action4 | class4 | method4 | null| null 4 | action1 | class1 | method1 | null| null as can see attributes keyid, action, class , method cant null. storenr , country can null. the dependencies following: method -> action action -> class storenr -> country my problem keyid. randomly created number serves purpose of tracking useractions. wouldnt there keyid impossible kind of actions user4 used in session. i dont know how handle when putting tabl...

c# - Template for ViewBag -

i want create template format viewbags. now, had case of property of of class, modify [uihint("mytemplate")] public virtual float foo { get; set; } every selction of property consider "mytemplate" , formate output correctly. how able transfer 'structure' viewbag, defined in controller? actuall, can't. contents of viewbag dynamically resolved @ runtime. opposed model properties. can use templates properties of model. the other option add model. reason behind that, model (or view model precise) ought have view needs display data. viewbag intended add flexibility data doesn't need in model contents of dropdownlist. therefore, if need display content viewbag properties in page, should consider promoting property model. alternatively, use partial views. @html.partial("_mytemplate",viewbag.data)

android - Google OAuth login page 'cancel' and 'accept' buttons are not enabled from Aug 22nd -

google oauth login page buttons not enabled on android 2.x browsers. because accept button disabled, users cannot login google. many users of our service report issue aug 22nd. it simple reproduce issue. in android 2.3.3 emulator -> launch browser -> go https://oauth2-login-demo.appspot.com/profile -> click login link. other browsers having same issues: opera : http://my.opera.com/community/forums/topic.dml?id=1745272 bb10 : google oauth accept button disabled hey google engineers. have plan fix issue? or workaround? this known issue google , working on it. can expected fixed end of week.

ios - force Portrait mode after being in Landscape mode and tapping back -

i have tabbar app navigationcontroller on each tab. first tab shows list of entries (roomsviewcontroller) navigate detail view (roomdetailviewcontroller). on detail view there's button navigates viewcontroller (photoviewcontroller). have set 1 last viewcontroller supports orientation changes, rest doesn't. works fine, have problem when i'm in landscape mode , go 1 viewcontroller (to roomdetailviewcontroller), stays in landscape mode , looks ugly. i have being in portrait mode after tapping back. on ios 5 , below added roomdetailviewcontroller , worked: [[uidevice currentdevice] setorientation:uiinterfaceorientationportrait]; unfortunately doesn't work on ios 6. any solutions that? in advance implement method in roomdetailviewcontroller, -(nsuinteger)supportedinterfaceorientations { return uiinterfaceorientationmaskportrait; }

Get particular matching values from json array using php code -

this response code: '[{"id":"153","title":"xyz","description":"abc"}, {"id":"154","title":"xyy","description":"abb"}]' in code need values id=154 , need particular array values using php code? if have variable $a=154; particular id , title , description values only. if have variable $a=153; particular id , title , description values only. $jsonstr = '[ {"id":"153","title":"xyz","description":"abc"}, {"id":"154","title":"xyy","description":"abb"} ]'; $arrjson = json_decode($jsonstr); $keyval = 154; foreach($arrjson $key => $val){ if($val->id == $keyval){ echo $val->id;//id echo $val->title;//title echo $val->description;//descrption } } ...

java - Inject inherited property values using CDI-Weld -

i'm developing basic swing application and, if tend use spring ioc (with xml configuration) dependency injection want give try cdi-weld. having following structure done in spring, container creates schoolboy , universitystudent , each 1 name. public class student{ protected string name; public void setname(string name){ this.name = name; } } public class schoolboy extends student{ } public class universitystudent extends student{ } <bean class="schoolboy"> <property name="name" value="daniel" /> </bean> <bean class="universitystudent"> <property name="name" value="rose" /> </bean> i've seen it's possible similar in cdi using @inject @config annotations. however, every single time see this, they're above property and, being inherited property, cannot classes here. how achieve each student subclass own name value? update i...

Conditional Menu in WordPress -

i'm trying show wordpress menu based on value of cookie. in example, i'm using cookies define geographical region user wants view. (i'm still working on part i'm manually defining during development.) based on this, want use either menu1 or menu2. i'm using following code: function pstv_set_cookie() { $expire=time()+60*60*24*30; setcookie("region", "1", $expire); } add_action( 'init', 'pstv_set_cookie'); if ($_cookie[$region] = "1"){ //use menu 1 wp_nav_menu( array('menu' => 'menu1' )); //wp_nav_menu( array( 'theme_location' => 'menu1' ) ); }elseif ($_cookie[$region] = "2"){ //use menu 2 wp_nav_menu( array('menu' => 'menu2' )); //wp_nav_menu( array( 'theme_location' => 'menu2' ) ); } this works expected, spits out menu html before else. where add coded h...

c# - How to add reference to Windows Media Player to my Visual Studio project? -

there following trouble: made c# application windows media player component (i added toolbox). created installer project, , there following dependencies: microsoft .net framework; axinterop.wmplib.dll; interop.wmplib.dll; wmp.dll; now when user tries install app takes error impossible loading "axinterop.wmplib, version=1.0.0.0, culture=neutral, publickeytoken=null". how can fix it? .net framework installed successfully. go solution explorer, right click references, add reference, com elements, browse, windows media player in programs, may add both exe , dll files, , add using in name spaces (using wmplib;)

C/C++ how to combine multiple arrays/lists of strings? -

i have 5 lists containing strings: append, word, middle, combo, prepend. (or s0,s1,s2,s3,s4). each list can randomly contain 0 256 strings on program start. how can output possible combinations? i tried cascade of for() loops, fails if list in middle contains 0 strings (eg s2). i assume use std::vector<string> s1,s2,s3,s4,s5; if ugly code: int = 1; (auto itr1 = s1.begin(), end1 = s1.end(); itr1 != end1; ++itr1) (auto itr2 = s2.begin(), end2 = s2.end(); itr2 != end2; ++itr2) (auto itr3 = s3.begin(), end3 = s3.end(); itr3 != end3; ++itr3) (auto itr4 = s4.begin(), end4 = s4.end(); itr4 != end4; ++itr4) (auto itr5 = s5.begin(), end5 = s5.end(); itr5 != end5; ++itr5) std::cout<<"solution "<<i++<< ": "<< *itr1 << " - " << *itr3<< " - " << *itr4<< " - " << *itr5 <<std::endl; its not elegant, ...

angularjs - twitter bootstrap accordion IE 9 troubles with selectbox -

i'm using angularjs twitter bootstrap. in html page i'm using accordion , in content of accordion have select box. works fine firfox, ie10, chrome ... in ie9 cuts off text in select box. shows first letter of text of preselected value. if click in select box, can see whole text. can tell me, how fix problem? seems problem accordion, because if put selectbox outside of accordion, selectbox works in ie9. i ran similar issue (angularjs 1.2.x) select dropdown defined single empty "please select" option, , updated values returned rest api; select initial value according data received subsequent rest call, upon page load. i think async updating confused ie9's rendering of select box (the rendering of accordion component resulted in similar situation). in our case maintain visible text width of initial 'please select' option, cutting off longer newly selected initial item (although rerender , resolve if user interacted control). managed resolve...

javascript - Finding the next element divisible by 4 -

so have list of elements so; <div></div> <div class="test"></div> <div></div> <div class="test2"></div> <div></div> <div></div> <div class="test3"></div> <div></div> <div class="test4"></div> <div></div> and need figure out next element relative selector order divisible four, counting beginning. if there aren't enough elements relative selector, last element returned. ergo, i'd following sort of results; $(".test").nextfour().after("hello"); // or $(".test2").nextfour().after("hello"); <div></div> <div class="test"></div> <div></div> <div class="test2"></div> hello <div></div> <div></div> <div class="test3"></div> <div></div> <div class="t...

events - Node.Js - letting users know someone is typing something -

i'm having chat app add imessage/facebook feature people know when each others typing something, changing name's color e.g. i have tried : $messagebox.keydown(function(){ if($(this).val().length!=0){ socket.emit('writing_message')}; }); socket.on('showing_writers',function(){ $users.html(''); // test if event received, not case... }); i hoping way, everytime user presses letters, trigger basic event on server, respond : socket.on('writing_message',function(){ io.sockets.emit('showing_writers', socket.nickname); } socket.nickname contains user's nickname use find him on client's files, in order change name's color. does know how in better way, , why i'm doing not working ?

javascript - What phase does stopPropagation effect? -

according quirksmode, modern browsers have capturing phase , bubbling phase. see here. if use stoppropagation in event handler ( set either phase boolean argument ) how function? will work both ways? if set capture mode, prevent bubbling phase. , vice-versa well. here w3 reference ( stoppropagation ). i'm troubleshooting event handler, , need understand how stoppropagation() functions. stopping propagation during capture phase prevent further handlers running, including handlers registered bubbling phase. the w3c documentation on event flow says (emphasis mine): this specification defines 3 event phases: capture phase ; target phase ; , bubble phase . event objects complete these phases in specified order using partial propagation paths defined below. a phase must skipped if not supported, or if event object's propagation has been stopped. example, if event.bubbles attribute set false, bubble phase skipped, , if event.stoppropaga...

java - Android AsyncTask use openFileOutputStream -

i have error in asynctask. tried save data fileoutputstream file, cause need data permanent. so iam reading tutorial: tutorial but if iam adding code asynctask error: "the method openfileoutputstream(string, int) undefined type mainactivity.downloadspielplan" downloadspielplan asynctask private class downloadspielplan extends asynctask <void, void, string> { @override protected void onpreexecute() { // todo auto-generated method stub super.onpreexecute(); } @override protected string doinbackground(void... params) { // todo auto-generated method stub //dont wonder reversestring created , filled delete part code more readability filename = "spieltag"; jour = reversestring; fileoutputstream fos = openfileoutputstream(filename, context.mode_private); fos.write(jour.getbytes()); fos.close(); ...

asp.net - Could not load file or assembly 'Microsoft.Threading.Tasks.Extensions.Desktop' or one of its dependencies. The parameter is incorrect -

i developing web application upload file on google drive gives exception :- not load file or assembly 'microsoft.threading.tasks.extensions.desktop' or 1 of dependencies. parameter incorrect. (exception hresult: 0x80070057 (e_invalidarg)) don't know means? please me... microsoft.threading.tasks.extensions.dll , microsoft.threading.tasks.desktop.dll 2 different assemblies , looks you're naming them in wrong way. please check on this side on more information on how build it.

machine learning - Code for analyzing thresholds in R model output -

i have textual classification problem consists of 2 categories- 0 one. until tried solving creating document term matrix, , run through svm (using rtexttools package). here's code snippet: (in r) models <- train_models(container, algorithms=c("svm")) results <- classify_models(container, models) analytics <- create_analytics(container, results) view(summary(analytics)) >>algorithm performance >>svm_precision svm_recall svm_fscore >> 0.64 0.63 0.63 my questions follows: 1.why predicted values in result matrix between 0.5-1? isn't supposed 0-1? 2.supposed have theta threshold separate scores above of class 1, , rest 0. how can analyze (in r) under theta these precision , recall values being calculated? how can change threshold different values? 3.how can create in r 2 different thresholds values each class (with what's left in between labeled "unidentified")?

c# - LINQ select statement with many to many -

i have relationship, project categories. relation many many have 3 tables: project / project_has_category / categories. i need select projects has relation category (by id) project class public class project { public int projectid { get; set; } public virtual icollection<category> categories { get; set; } } category class public class category { public int categoryid { get; set; } public string categoryname { get; set; } public virtual icollection<project> projects { get; set; } } i have tried following: [httppost] public actionresult projects(string catid, string strsearch) { var cats = adapter.categoryrepository.get(); var projects = adapter.projectrepository.get().where(x => x.categories.contains(catid)); /*also*/ var projects = adapter.projectrepository.get().where(x => cats.contains(catid)); return view(projects); } but gives error: the best overloaded method match 'system.collections.generi...

rest - codeigniter form validation always false with json data -

i using codeigniter build own rest web service, application have resource called " calls " , can access via post method, the " calls " function receive 4 parameters [id, manager, department, level] json object via curl call using content-type:application/json then using codeigniter form_validation() library validate request return array of response if no error on form_validation() the problem form_validation() returns false although can output received value expected. below code of calls function function calls_post() { $this->load->model('api/central'); $this->load->library('form_validation'); //validation rules $this->form_validation->set_error_delimiters('', ''); $this->form_validation->set_rules('id', 'id', 'required|numeric'); $this->form_validation->set_rules('manager', 'manager', 'required|numeric'); $this->form_validation->s...

Need WMI query to get the dll information from Windows Server 2006 -

need wmi query assmebly file details udner path : c:\windows\assembly\gac_msil i want monitor path once in day , information on : 1.assembly name 2.date created 3.date modified 4.full name 5.public key token i don't want powershell script these details. needed wmi query. more information: i used wmi query : "select * cim_datafile " doesnt work . displays description : "invalid class" . please let me know correct class name , namespace many thanks, simbu the right way of using cim_datafile this: "select * cim_datafile drive ='c:' , path='\\demo\\' , filename='u' , extension='dll'" but, don't think give publickey token.

c# - Reporting Services (.RDLC) Two Datasets -

i have .rdlc 2 datasources. when using datasource named "dslancamentos", working fine. now, i've add second one, named "dsdespesas", , report viewer throws message: a data source instance has not been supplied data source 'dsdespesas'. and here code: var dsreportlancamentos = new dsreportlancamentostableadapters.pr_report_lancamentostableadapter(); var dsreportdespesas = new dsreportlancamentostableadapters.pr_report_sea_despesastableadapter(); var tabela = (datatable)dsreportlancamentos.getdata(txtnomeproduto.text, funcoes.getdatetimevalueornull(datade), funcoes.getdatetimevalueornull(dataate), funcoes.getbytevalueornull(status)); var despesas = (datatable)dsreportdespesas.getdata(funcoes.getdatetimevalueornull(datade), funcoes.getdatetimevalueornull(dataate)); // configuraÇÕes report ----------------------- reportdatasource rds = new reportdatasource("dslancamentos", tabela); reportdatasource rdsdespesa = new reportdatasource(...

Launch Firefox with Python 3.x -

i'm trying write script launch firefox me, open google in new tab, , able search (for instance, www.espn.com). i'm trying achieve using webbrowser module, run error each time try launching firefox script. also, firefox not default browser. import webbrowser webbrowser.get('firefox').open_new_tab('http://www.google.com') whenever run following error: traceback (most recent call last): file "c:/python33/test bing.py", line 6, in <module> webbrowser.get('firefox').open_new_tab('http://www.google.com') file "c:\python33\lib\webbrowser.py", line 53, in raise error("could not locate runnable browser") webbrowser.error: not locate runnable browser i'm unsure why script struggling locate firefox.exe have tried specifying in 'firefox' actual location of firefox.exe in c: still same error. i'm sure there's small error in code can't see, if point out i'm doing wrong i...

javascript - Call function from Ajax reloaded page -

with ajax request reload page , based on conditions database want call javascript function on main page (because need variables main page). php code: if($reset_regionaal == 1 or $reset_landelijk == 1 or $reset_extra == 1){ echo "<script>window.resetopties(".$reset_regionaal.",".$reset_landelijk.",".$reset_regionaal.");</script>"; } js code: function resetopties(regionaal_opvallen_reset, landelijk_opvallen_reset, extra_opvallen_reset){ alert(regionaal_opvallen); }; but not work, not execute function. function simplified of course if function called before defined, won't execute , cause error.

java - com.jacob.com.ComFailException: Can't co-create object -

i'm using jacob load system certificate. working fine when run code using public static void main(string args[]) or simple java program when try run code using applet i'm getting error follow... com.jacob.com.comfailexception: can't co-create object @ com.jacob.com.dispatch.createinstancenative(native method) @ com.jacob.com.dispatch.<init>(dispatch.java:99) @ com.jacob.activex.activexcomponent.<init>(activexcomponent.java:58) @ com.digicorp.root.systemwrapper$1.run(systemwrapper.java:23) @ java.security.accesscontroller.doprivileged(native method) @ com.digicorp.root.systemwrapper.<init>(systemwrapper.java:19) @ com.digicorp.applet.digitalcertificateapplet.activexobject(digitalcertificateapplet.java:56) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.re...

linux - Find mac address on python -

i have searched identifier , tried find mac address connected device on server problem output returns empty example a = os.popen("arp -a 192.168.6.150 | awk '{print $4}'").readlines() a empty i'm working on captive portal page untangle. want mac address ip of device on network. code runs on apache server. from mod_python import apache mod_python import util the following function returns mac or none if mac not found. import commands def getmac(iface): mac = commands.getoutput("ifconfig " + iface + "| grep hwaddr | awk '{ print $5 }'") if len(mac)==17: return mac getmac('eth0')

html - border radius rounded corners into parent and child <div> -

Image
i have problem hover on div, has border-radius. when hover div there small line color not similar hover color. html code: <div class="grid_veiw_case_active"> <div> text</div> <div class="delete_div"> <div class="delete"><p class="button_text"></p></div> </div> </div> css(part) code: .grid_veiw_case_active { border-style: solid; border-width: 1px; border-color: #404040; border-radius: 5px; background: #7d7d7d; width: 254px; } .grid_veiw_case_active .delete { border-top: 1px solid #969696; width: 100%; height: 38px; -webkit-border-bottom-right-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background: #c1c0c0; } .grid_veiw_case_active .delete:hover { backgrou...

vbscript - Can't query windows 7 registry remotely using WMI -

i used following vb script query registry value remotely using wmi. able connect, couldn't value. option explicit dim strcomputer dim struser, strpassword dim objswbemlocator, objswbemservices, objreg dim strkeypath, strentryname, strvalue const hkey_local_machine = &h80000002 strcomputer = "192.168.1.10" struser = "username" strpassword = "password" set objswbemlocator = createobject("wbemscripting.swbemlocator") set objswbemservices = objswbemlocator.connectserver _ (strcomputer, "root\default", struser, strpassword) set objreg = objswbemservices.get("stdregprov") strkeypath = "system\currentcontrolset\services\eventlog\application" strentryname = "maxsize" objreg.getdwordvalue hkey_local_machine, strkeypath, strentryname, dwvalue wscript.echo dwvalue it returns: microsoft vbscript runtime error: variable undefined: 'dwvalue'. means didn't value target machine. checked o...

actionscript 3 - AS3 Flash CS5 - XML node filters? -

i did find piece of code (slightly edited): var destinations:xml = <destinations> <destination location="japan"> <exchangerate>400</exchangerate> <placesofinterest>samurai history</placesofinterest> </destination> <destination location="australia"> <exchangerate>140</exchangerate> <placesofinterest>surf , bbq</placesofinterest> </destination> <destination location="peru"> <exchangerate>30</exchangerate> <placesofinterest>food</placesofinterest> </destination> </destinations>; //filter attribute name ------------------- var filteredbylocation:xmllist = destinations.destination.(@location == "japan"); trace("attribute name: "+filteredbylocation); //filter node value ---------------------- var filteredbyexchangerate:xmllist = destinatio...

How to exclude some strings in C# Regex? -

this current code: var formula = "scan: \"sample.test\" or 'batch.id' , if (results.tune)))"; if (formula.indexof("field(", stringcomparison.ordinalignorecase) == -1) { formula = regex.replace(formula, "[a-za-z]\\w+\\.[a-za-z_]\\w*", "field(\"$0\")"); } the output looks like: "scan: \"field(\"sample.test\")\" or 'field(\"batch.id\")' , if (field(\"results.tune\"))))" however, i'd skip first 2 matches. so, if term quoted, not replace it. expected output should like: "scan: \"sample.test\" or 'batch.id' , if (field(\"results.tune\"))))" i managed expected result using 2 passes: var formula = "scan: \"sample.test\" or 'batch.id' , if (results.tune)))"; if (formula.indexof("field(", stringcomparison.ordinaligno...

java - Use LinearLayout to display multiple images -

Image
trying set image on image view stretch image based on screen size , auto fit images doesn't go beyond screen. my mainactivity: package com.example.testting; import android.os.bundle; import android.app.activity; import android.view.menu; import android.widget.imageview; import android.widget.linearlayout; import android.widget.relativelayout; import android.widget.relativelayout.layoutparams; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); linearlayout ll = (linearlayout) findviewbyid(r.id.lllayout); for(int i=0;i<10;i++) { linearlayout.layoutparams layoutparams = new linearlayout.layoutparams(r.dimen.num_icon, r.dimen.num_icon); imageview ii= new imageview(this); ii.setbackgroundresource(r.drawable.apple); ii.setlayoutparams(layout...

ios - data in tableview is pile up when scrolling -

how create data in tableviewcell when scrolling not pile ? -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *thecell = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:thecell]; if (! cell) { cell = [[uitableviewcell alloc]initwithstyle:uitableviewcellstylesubtitle reuseidentifier:thecell]; } uilabel *data1 = [self createlabeltext:[nsstring stringwithformat:@"%@",[[arrayutama objectatindex:indexpath.row]objectforkey:@"nomer"]]withframe:cgrectmake(10, 10, 150, 50) withfont:[uifont fontwithname:@"arial" size:16] withcolor:[uicolor clearcolor]]; [cell insertsubview:data1 atindex:0]; uilabel *data2 = [self createlabeltext:[nsstring stringwithformat:@"%@",[[arrayutama objectatindex:indexpath.row]objectforkey:@"subjek"]]withframe:cgrectmake(50, 10, 150, 50) withfont:[uifont fontwithname:@...