Posts

Showing posts from July, 2011

Highstock- limit grid lines for y axis -

Image
how can show grid lines on middle of chart, please see attached image you can loop on ticks , remove gridlines not @ first / last , 0 point. $.each(chart.yaxis[0].ticks,function(i,line){ if(!line.isfirst && !line.islast && line.pos!=0) { line.gridline.destroy(); } }); example: http://jsfiddle.net/hjpchasj/2/

php - How to escape a slash while reading an excel -

im reading excel line line , doing php operations in backend ,but when reached cell containing "\" throwed error it has match cell value , backend value cell value "test-123\/123a" backend value "test123/123a" i tried reading cell value str_replace("\/","/",$cellvalue); but error still persists you can try php function stripslashes http://php.net/manual/en/function.stripslashes.php

opencv - Remove lens distortion from images captured by an wide angle (180) camera -

Image
i have images captured wide angle appx. (180 degree) camera. using opencv 2.4.8 gives details camera matrix n distortion matrix. matk = [537.43775285, 0, 327.61133999], [0, 536.95118778, 248.89561998], [0, 0, 1] matd = [-0.29741743, 0.14930169, 0, 0, 0] and info have used further remove distortion. result not expected. have attached input images of chess board have used calibrate. or there other tools or library can removed. input images from normal camera or captured smart phone this not answer question, "discussion" of distortion , planarness. in reality have straight lines on pattern: with (nearly any) lens you'll kind of distortion straight lines aren't straight anymore after projection image. effect stronger wide angle lenses. expect (for wide angle stronger similar): but images provided more this, can because of pattern wasnt planar on ground, or because lens has additional "hills" on lens.

Can I decode JSON containing PHP code? -

is possible have json string containing php code, , have string decoded? for example, works should: $array = ["page", "is-home", $_server["request_uri"] == "/"]; var_export($array); // array ( // 0 => 'page', // 1 => 'is-home', // 2 => false, // ) this, not work: $json = '["page", "is-home", $_server["request_uri"] == "/"]'; $array = json_decode($json); // returns null echo json_last_error_msg(); // syntax error the second example work if $_server["request_uri"] == "/" removed json string. is there way parse string using json_decode, , if not, there alternative methods accomplish this? many thanks! update the $_server["request_uri"] == "/" has parsed. trying extend blade templating can implement parsed functions such this: @add-request('page', 'is-home', $_server["request_uri"]

Why is there no built-in grep in Windows? -

in e.g. question is there pattern matching utility grep in windows? , 1 can find few options adding grep utility windows. wondering why it's case there no built-in grep-like function in windows, seems supremely useful thing (at least linux user). more specifically, there technical reason this? e.g. difference in os/filesystem architecture between windows , linux make more difficult/slow/pointless/unsafe/etc. have such functionality in windows? (i can imagine example antivirus might not program read thousands of files in 1 go, , because of microsoft perhaps decided scrap grep utility. that's of course pure speculation on behalf, it's kind of answer i'm looking for) "grep" unix tool - made unix. as far functionality goes , have built-in "grep". windows offers similiar through commands find , findstr , quite lot, , have been available long time. plus, can search file content through windows search.

java - Detect the Windows key modifier -

how can detect windows key modifier keyevent ? have add code: textfield.addkeylistener(new keyadapter() { public void keyreleased(keyevent e) { if ((e.getkeycode() & keyevent.vk_escape) == keyevent.vk_escape) { textfield.settext(""); } } }); but problem is, when use windows zoom , try exit using win + escape , if focus in textfield , content clears. i've tried filter e.getmodifiersex() , returns 0 . way i've found detect whether windows pressed or not, create boolean field , change it's value when windows pressed/released. so, there way windows key pressure state keyevent escape released event? the way used myself: abstractaction escapeaction = abstractaction() { public void actionperfomed(actionevent e) { settext(""); } } textfield.addcaretlistener(new caretlistener() { @override public void caretupdate(caretevent e) { if (textfield.gettext() == null ||

html - CSS nested div:hover does not work -

intention: a div pretty picture , title when visitor hovers on div, pretty stuff replaced descriptive text a css-only solution simple, right? here's trying: html: <div class="drunter"> below <div class="drueber"> on top </div> </div> css: .drunter { position:relative; background-color:#f00; } .drueber { position:absolute; top:0; right:0; bottom:0; left:0; display:none; background-color:#00f; } .drueber:hover { display:block; } jsfiddle why not working? when view page in chrome , go inspector, switch on :hover state on "drueber" element, works expected. when hover on div, nothing happens. as .drueber has display:none; property can't hovered. need trigger hover event on parent : .drunter:hover .drueber { display:block; } demo

Update OpenSSL on CentOS 6.5 -

i have 2 centos servers. on 1 server have openssl 1.0.1e-fips 11 feb 2013 , on other 1 have openssl 0.9.8e-fips-rhel5 01 jul 2008. how can update openssl 0.9.8 1.0.1 or newer? tried yum update, yum update openssl receive no packages marked update. thanks! centos 5 not have official package of openssl newer 0.9.8 cannot upgrade system package 1.0.1. if need 1.0.1 on centos 5 server can compile/package cannot replace 0.9.8 package/files without recompiling else on system well.

mysql - Database table not deleted if it's empty -

i have issue following code seems: $table_name = $wpdb->prefix . "project_name_" . $result2->projectname; $wpdb->query("drop table if exists $table_name"); it delets table if has content in it. greate! in cases table may empty. in case it's totaly empty databse table not deleted. why? how fix this? kind regards johan test return of function. query (string) : sql query wish execute. this function returns integer value indicating number of rows affected/selected. create , alter , truncate , drop sql statements, function returns true on success. if mysql error encountered, function return false . note since both 0 , false may returned, can use equality == operator test falsy returns (i.e., returned value logically false ). using identicality === operator may result in unexpected behavior compares types returned in addition values... class reference/wpdb

sas - Create function of two variables with do loop -

i calculate variables ar_1 ar_99 based upon formula ar_(i) = 0.5*(adm_(i) + adm_(j)) where j=i+1 (adm_1 adm_100 exist in dataset). using following loop error sas not recognise variable j. %macro do_loop; data testdo; set popn99; %do = 1 %to 99; &j.=&i.+1; ar_&i. = 0.5 * (adm_&i. + adm_&j.); %end; run; %mend do_loop; %do_loop; try: %macro do_loop; data testdo; set popn99; %do = 1 %to 99; ar_&i. = 0.5 * (adm_&i. + adm_%eval(&i.+1) ); %end; run; %mend do_loop; %do_loop; remember sas macro code writes text only. following assignment, should have resolved (which wouldn't "j" macro variable didn't exist), have assigned value "column". &j.=&i.+1; that not have been re-used macro variable in subsequent step. to generalise - sas macro language writes sas programs (base code) subsequently execute produce results..

ios - queries on plist in objective-c -

hi heard plist same database in ios, question hitting in mind can execute dml ddl etc statements on plist, if yes simple example appreciated, if no means, why? m fresher in ios development. thank you. the answer "no". you can use sqlite executing these statements. property lists plist list of nested key-value pairs can contain common data types strings, numbers, arrays , dictionaries. pros simple understand. easy work with. cons cannot run complex queries on them (at least not easily). have read entire file memory data out of , save entire file modify in it. sqlite until coredata came along, popular way read , write data in iphone applications. if web developer, ain’t nothing new. pros unlike plists, don’t have load whole database front. makes sqlite more suitable applications lots of data. better plists slicing , dicing data. cons steeper learning curve plists. can tedious work with. core data its new, exciting, , developers us

php - How to allocate? -

$capture_field_vals =""; foreach($_post["mytext"] $key => $text_field) { $capture_field_vals .= $text_field .", "; } $insert = "insert tabel1(numbers) values('$capture_field_vals')"; in database (5342324, 23432423, 24234242, 234234234) and want do.. $insert2 = "insert tabel2(number1, number2, number3, number4) values('$capture_field_vals[0]','$capture_field_vals[1]','$capture_field_vals[2]','$capture_field_vals[3]')"; $capture_field_vals=array(); foreach($_post["mytext"] $key => $text_field){ array_push($capture_field_vals,$text_field); } then $insert2 = "insert tabel2(number1, number2, number3, number4) values('$capture_field_vals[0]','$capture_field_vals[1]','$capture_field_vals[2]','$capture_field_vals[3]')";

c++ - A faster thread blocks slower thread -

i'm working on point cloud viewer, , design based on 2 thread first thread updates point cloud data ( 10 fps) second thread d3d renderer render point set screen (about 90 fps) so code looks this: std::shared_ptr<pointcloud> pointcloud; critical_section updatelock; void firstthreadproc() { while(true) { /* algorithm processes point cloud, takes time */ entercriticalsection(&updatelock); pointcloud->update(data,length,...); //also takes time copy , process leavecriticalsection(&updatelock); } } /*...*/ std::shared_ptr<d3drenderer> renderer; void secondthreadproc() { msg msg = { 0 }; while (wm_quit != msg.message) { if (peekmessage(&msg, null, 0, 0, pm_remove)) { translatemessage(&msg); dispatchmessage(&msg); } else { entercriticalsection(&updatelock); renderer->render

submit php form checked checkbox -

i can't submit checked bar of form. when submit, submit last bar of form. please me how submit checked bar? <table border="1" align="left"> <?php echo '<th>stock name</th>'; echo '<th>price</th>'; echo '<th>amount</th>'; echo '<th>buy ?</th>'; ?> <form method=post action=inputer.php > <input type=hidden name=idcustomer value="<?php echo $idcustomer ?>" /> <?php $show=mysql_query("select * `tblstock`"); while($result=mysql_fetch_array($show)) { ?> <input type=hidden name=idstockname value="<?php echo $result[0] ?>" /> <?php echo'<tr><td>'.$result[1].'<input type=hidden name=stockname value='.$result[1].'/></td>'; echo' <td>'.$result[3].'<input type=hidden name=price value='.$result[3].'/><

scala - How to send a process to multiple sinks in scalaz-stream -

if have simple process emitting values of type string , wish send these multiple sinks (i.e. each sink gets sent string ), how do this? for example, running program: object play extends app { def prepend(s: string): string => string = s ++ _ val out1 = io.stdoutlines.map(prepend("1-") andthen _) val out2 = io.stdoutlines.map(prepend("2-") andthen _) val p = io.stdinlines (out1 merge out2) p.run.run } the output looks like: a //input 1-a b //input 2-b c //input 2-c d //input 1-d i want output this: a //input 1-a 2-a b //input 2-b 1-b c //input 2-c 1-c d //input 1-d 2-d edit i can achieve follows: implicit class toboth[o](p: process[task, o]) { def toboth(s1: sink[task, o], s2: sink[task, o]): process[task, unit] = { (for (o <- p; n <- process.emit(o) ++ process.emit(o)) yield n) (s1 interleave s2) } } that is, duplicate input , interleave output. can generalized: def toall(sinks

java - Extract interfaces from a class -

i want generate interface model class in eclipse/intelij generating single class quite easy right click --> refactor --> generate interface but problem have 100's of classes. is there tool/plugin or script can generate multiple interface in 1 go single package. or maven plugin so. http://mojo.codehaus.org/gwt-maven-plugin/generateasync-mojo.html here got plugin generate generateasync probably fastest way write own simple application operation.

ios - Can I create a WatchKit app without a storyboard (entirely in code)? -

my team working on ios application in don't use storyboards @ all. create ui in code instead. consistency's sake great if create watch app target entirely in code. however, both "getting started watchkit" video , watchkit framework reference mention need storyboard watch app target. furthermore, in wkinterfaceobject.h init method marked unavailable: - (instancetype)init ns_unavailable; so impossible create watch app without using storyboards? if so, reasons behind decision? mean, can create iphone / ipad app entirely in code, why different watch? if read watchkit programming guide see app executing on user's iphone , app sends information displayed watch watchkit. as there none of code executing on watch itself, can't perform programmatic layout - watchkit uses storyboard provide layout , render information provided app running on iphone. apple has said possible develop native watch applications in future, may possible then.

javafx - Tableview row style -

i have tableview want apply depend on value of row item diferent styles. for example: each row represents person property years, if person < 18 years, row color should red. if person > 60 years, row color should greeen... i search on apply style rows, cases try apply selected rows , others use cellfactories (i don't know if possible style whole row or need apply style each field). just set row factory. best way manage styles use css pseudoclass s . in example have 1 "young" , 1 "old": psuedoclass old = pseudoclass.getpseudoclass("old"); psuedoclass young = pseudoclass.getpseudoclass("young"); tableview.setrowfactory(tv -> { tablerow<person> row = new tablerow<>(); changelistener<number> yearslistener = (obs, oldage, newage) -> { int age = newage.intvalue(); row.pseudoclassstatechanged(old, age > 60); row.pseudoclassstatechanged(young, age < 18); };

ios - Trying install XCODE on m MAC -

i trying install xcode on mac .i tried 2 options. 1). using command line tools. i typed xcode-select --install gives me below error. xcode-select: error: no command option given. xcode-select: report or change path active xcode installation machine. usage: xcode-select --print-path prints path of active xcode folder or: xcode-select --switch sets path active xcode folder or: xcode-select --version prints version of xcode-select 2). after tried install app store there giving me error as xcode can’t installed on “machintosh hd” because os x version 10.9.4 or later required. btw trying install xcode version 6.1. could 1 me why not able install xcode on mac. regards, rajesh i think second error message told need know. need running os x 10.9.4 or later.

python - Tricky Django QuerySet with Complicated ForeignKey Traversals -

i adapting jim mcgaw's e-commerce site beginning django e-commerce client's use. client sells builds of computers composed of custom set of parts. parts go system change. instance, super samurai system sold 2 years have different parts 1 sell tomorrow. sell each super samurai system need snapshot of parts went super samurai @ moment in time of sale. i having problem queryset copies of parts table maps parts builds (i.e. parts go super samurai)... class build(models.model): build = models.foreignkey(partmodel, related_name='+') part = models.foreignkey(partmodel, related_name='+') quantity = models.positivesmallintegerfield(default=1) class meta: abstract = true unique_together = ('build', 'part') def __unicode__(self): return self.build.name + ' ' + str(self.quantity) + ' * ' + \ self.part.family.make.name + ' ' + self.part.name class buildpart(build)

c++ - How to use auto_ptr in this case -

i have following code: void do_something(image *image) { image *smoothed = null; image *processed = null; if (condition_met) { smoothed = smooth(image); processed = smoothed; } else { processed = image; } ... delete smoothed_image } i wondering if can following , if correct way. confused setting pointer auto_ptr object , whether changes ownership somehow. void do_something(image *image) { auto_ptr<image *> smoothed; image *processed = null; if (condition_met) { smoothed = smooth(image); // should own pointer returned smooth processed = smoothed; // ok? processed not auto_ptr } else { processed = image; } ... // destructor 'smoothed' variable should called. // 'image' variable not deleted. } will destructor called intend , correct way this? a few points make. assuming signature of smooth function image* smooth(image*); th

How to keep negative numbers in assembly language TASM ? x86 -

;i have problem , should solve given numbers pls help!!! ;13. (a+b+c*d)/(9-a) ;a,c,d-byte; b-doubleword assume cs:code, ds:data data segment db 11 b dd 1 c db -2 d db 2 res1 dw ? finalres dw ? data ends code segment start: mov ax, data mov ds, ax mov al, cbw mov bl,9 cbw sub bx,ax mov res1, ax mov al, c cbw mul d mov cl,a cbw add ax,cx mov bx, word ptr b mov cx, word ptr b+2 add bx, ax adc cx, dx mov ax, bx mov dx ,cx mov cx, res1 cwd div res1 mov finalres, ax mov ax, 4c00h int 21h code ends end start your code contains multiple errors: mov al, cbw mov bl,9 ## cbw conversion al -> ax ## cbw/cwd instructions influence ax ## register. not possible use cbw ## bx register! ## ## btw: value of bh part of bx ## register undefined here! cbw sub bx,ax mov res1, ax mov al, c cbw ## mul unsigned multiplication! ## imul signed one! mul d mov cl,a ## again try use cbw register ## ax -> destroy ax ## register! cbw add ax,cx ## because

google maps - Get latitude and longitude for Android App (getLastKnownLocation is null) -

i latitude , longitude current location in app. testing on galaxy wi-fi 5.0. need numbers in double format gonna use in google-maps-url. problem lm.getlastknownlocation(locationmanager.gps_provider) returns null , nullpointerexception. private void getlatitudelongitude() { locationmanager lm = (locationmanager)getsystemservice(context.location_service); location location = lm.getlastknownlocation(locationmanager.gps_provider); if(location != null) { showmyaddress(location); } final locationlistener locationlistener = new locationlistener() { public void onlocationchanged(location location) { showmyaddress(location); } public void onproviderdisabled(string arg0) { // todo auto-generated method stub } public void onproviderenabled(string arg0) { // todo auto-generated method stub } public void

getting Failure [INSTALL_FAILED_OLDER_SDK] while running my first android app -

i new android , trying run first android app using android studio. app not getting installed in emulator device , getting message. failure [install_failed_older_sdk] after searching on net found happens when device has api level lower of minsdkversion. not case here. following build.gradle apply plugin: 'com.android.application' android { compilesdkversion 'android-l' buildtoolsversion "20" defaultconfig { applicationid "com.example.parikshit.myapp" minsdkversion 14 targetsdkversion 19 versioncode 1 versionname "1.0" } buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:20.+' } the emulator device nexus 5 kitkat version.i don't know wrong here.

c# - FileSystemWatcher OnChanged event not updating the web page UI -

onchanged event not updating web page ui. program control flows onchanged event , updates values of ui components not getting reflected on webpage. public void filewatcher() { filesystemwatcher watcher = new filesystemwatcher(); watcher.path = xmldirectory; watcher.notifyfilter = notifyfilters.lastwrite; watcher.filter = "*.xml"; watcher.changed += new filesystemeventhandler(onchanged); watcher.enableraisingevents = true; } private void onchanged(object source, filesystemeventargs e) { txtstatus.text ="changed"; btncheck.enabled = false; }

scala - Missing parameter type for expanded function when not assigned to a variable -

this question has answer here: type inference fails on set made .toset? 3 answers i noticed strange behavior of scala compiler. code: seq("?").toset foreach (println(_)) produces following error: error: missing parameter type expanded function ((x$1) => println(x$1)) seq("?").toset foreach (println(_)) ^ same happens this: seq("?").toset foreach (x => println(x)) i found 2 ways around this. ether specify type explicitly: seq("?").toset[string] foreach (println(_)) or save variable: val s = seq("?").toset s foreach (println(_)) is reasonable behavior or compiler bug? doesn't make lot of sense me. how explained? it expands to: seq("?").toset foreach (println(x=>x))

android - Find rss feed by search query -

looking on rss apps in store, found out, of them allow user type text in search rss editbox, , show list of founded rss feeds. how that? there exists free public api, searching rss feeds?? yes, use different apis that, check out google feed api more information. here's developer's guide. it's pretty straightforward: https://developers.google.com/feed/v1/jsondevguide i'm developing rss app android myself, don't hesitate ask me should need :)

bluetooth lowenergy - Why the App doesn't reconnect to the BLE device when set autoConnect to true in Android? -

i develop in android , ble . want app automatic reconnect ble device after ble device disconnect come in range , advertising. i use following code connect ble device: public void connect(final string address) { // todo auto-generated method stub log.w(tag, "bluetoothleservice connect function."); if(mbluetoothadapter == null || address == null){ log.w(tag, "bluetoothadapter not initialized or unspecified address."); //return false; } final bluetoothdevice device = mbluetoothadapter.getremotedevice(address); mbluetoothgatt = device.connectgatt(this, true, mgattcallback); } i have set autoconnect true , didn't reconnect when ble device has disconnect , come in range. why app doesn't reconnect ble device when set autoconnect true in android? did missing ? thanks in advance. the auto connect parameter determines whether actively connect remote device (or)

c++ - How do I pass standard generators to STL functions? -

#include <random> #include <algorithm> #include <vector> int main() { std::vector < int > = {1, 2, 3}; std::mt19937 generator; std::random_shuffle(a.begin(), a.end(), generator); } i trying compile code g++ -std=c++0x, receiving huge compiler dump ending /usr/include/c++/4.9.2/bits/random.h:546:7: note: candidate expects 0 arguments, 1 provided any way of doing correctly? the overload of std::random_shuffle you're trying use takes "randomfunc": function object returning randomly chosen value of type convertible std::iterator_traits<randomit>::difference_type in interval [0,n) if invoked r(n) in c++14, std::random_shuffle deprecated in favour of std::shuffle , takes generator rather "randomfunc". change function std::shuffle .

c# - Find a credit card within a string -

i looking way detect credit card within string using c#. regex possibility. not want detect if string credit card. for example string text = "hi mum, here credit card 1234-1234-1223-1234. don't tell anyone"; bool result = textcontainscreditcard(text); if (result) throw new invalidoperationexception("don't give people credit card!"); you can use regex like (\d{4}[\s-]?){4} and put chars want separator [\s-] space , minus and allows separators in position (\d[\s-]?){16} 1 2341234-12341 234

Eclipse Luna + Jboss Tools = Heap space error while editing HTML or JS -

i need use hibernate in projects , need better code completion when editing html file or jsf file, installed jboss tools eclipse marketplace. use combo since 2010 , since last update experiencing random "out of memory error" in eclipse. i've edited config file enhance heap , perm space, more 3gb dedicated, error still persist. is experiencing this? has found solution? i think there lot of people same issue, because after fresh installation of both ide , plug-in issue persists. on google can't find useful , don't think solution not incrementing heap more, because memory inspector shows usage of less 300mb , heap 3gb @ moment. when error occurs heap space blown instantly 300mb 3gb , after bunch of second ide shows error popup. after error, heap became less 300mb. note: issue manifesting jdk 1.7, 1.8 (all updates of , last year) , on windows pc (it happens both windows 7 , windows 8/8.1 ) i did intense investigation on issue. found wasn't cau

c# - Order of 1:n relation using virtual List<T> -

i use entity framework , mvc. need address list order address id. when encapsulate property sort entity framework doesn't fill address list. can do? public class student { public int studentid { get; set; } public string name{ get; set; } public string surname{ get; set; } //i need address list order address id??? public virtual list<studentaddress> address { get; set; } } public class studentaddress { [key] public int addressid{ get; set; } public string address { get; set; } public string city { get; set; } } relationships considered unordered per standard of relational modelling won't able , shouldn't rely on order, should apply ordering before presenting data. can select anonymous type ordered addresses like: students.select(x => new { student = x, addresses = x.address.orderby(y => y.addressid)) }) and if worry code duplications can wrap separate method , reuse it.

c# - How to select varying amount of columns with ExecuteStoreQuery -

i'm dynamically building select query varying number of columns. select col0, b col1, ..., c coln ... the query supposed retrieve matrix of integers. when executing query objectcontext.executestorequery , right amount of lines each line seems empty. here code: var lines = context.executestorequery<list<int>>(querystring).asenumerable() how make work? i found here should using ado.net kind of things. unfortunately entity framework 6 not have lot of flexibility in internal mapping code, not able map sql result list<int> or other collection of primitive types. to understand why not able it, need know internally ef6 uses dbdatareader read sql results, builds columnmap expected generic result type (in case type generic list), , performs dynamic translation of sql results result object using columnmap know column map property of object. per explanation above, ef6 executestorequery method trying map columns ("a", &qu

Retrieve all jenkins parameters to iterate in groovy code -

based on this answer, iterate on properties in jenkins job , replace value in job in build step. e..g. file = new file("folder/path/myfile.cs") filetext = file.text; filetext = filetext.replaceall("parameter", "parametervalue"); file.write(filetext); i saw example resolve 1 param this: build.buildvariableresolver.resolve("myparameter") but need to iterate on of them to in build step (after pulling source code) in current build. how can it? the following sample groovy code can use scriptler plugin , suggest use. code can correctly read environment variables set in jenkins job: import jenkins.model.jenkins def thr = thread.currentthread() def build = thr?.executable def env = build.getenvironment() def buildnumber = env.get("build_number") in case want read build parameters (you have parameterized build , need access variables), need use previous code , add following: def bparams = build.get

ssis - SQL Server version -

i´m trying run ssis 2013 package in sql server 2014 keep getting error "package migration version 8 version 6 failed error". so ckecked vertion in sql server 2014 using t-sql query: select @@version and got: "microsoft sql server 2012 (sp1) - 11.0.3153.0 (x64) jul 22 2014 15:26:36 copyright (c) microsoft corporation enterprise edition: core-based licensing (64-bit) on windows nt 6.1 (build 7601: service pack 1) " the response query should sql server 2014, right? what should alter this? this has nothing running package. ran same error. happened package deployed integration services server (version 2012) using 2014 wizard (or visual studio 2013 ssdt)... ssis , visual studio 2013 not work sql server 2012. there several microsoft connect tickets doubt of them fixed.

javascript - Get content in same div jQuery -

i've got gallery on website each of them unique id. i'm trying idea work: click on first image = content of first image. click on second image = content of second image.. etc etc. currenlty i've set each image unique id seen below: echo "<img src='http://bsc.ua.edu/wp-content/uploads/2012/01/white-placeholder-100x100.jpg' data-original='$thumbnail[0]' width='$thumbnail[1]' height='$thumbnail[2]' class='lazygallery' id='$thumb_id'/>"; and jquery can content in screen, 1 one. if click img1 content 1. got 2 loops, 1 thumbnails , 1 content: thumbnail: echo '<div class="gallery">'; while ($loop->have_posts()) : $loop->the_post($post->id); $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->id), 'gallery-thumb', true, ''); $thumb_id = get_the_id(); echo "<img src='http://bsc.ua.edu/wp-content/uploads/2012/01/white-placehol

c# - Assign variable to Expression<Func<TSource, bool>> -

using net 4.5.1 have following class respondent: namespace whatever { public class respondent { public int x { get; set; } public int y { get; set; } public static expression<func<respondent, bool>> comparexy(int value) { return x => ((x.x * 100) + x.y) > value; } } } lets want pass body of lamdba around. getting by: ... function ... type membertype = typeof(<this class>).assembly.gettype("whatever.respondent"); object[] parameters = new object[] { <populate integer value> }; var expr = membertype .getmethod(memberfunctionname, bindingflags.public | bindingflags.static) .invoke(null, parameters) lambdaexpression; return expr.body problem variable x (i.e. respondent) not defined. example, functional expression comparexy might included in larger expression tree derives series of predicates (i.e. standing comparisons, literals, functions, etc): ...function returning expression<func<responde

java - Using mockito with wildcard agruments -

i trying pass wildcard mockito any() method. method selectgatewayinfoconfig(operation<?> o) what trying is: when(gatewayconfigselector.selectgatewayinfoconfig( any(**!!!!!! here need wildcard !!!!**)); .thenreturn(...something...); thanks in advance. how about? when(gatewayconfigselector.selectgatewayinfoconfig( any(operation.class)); .thenreturn(...something...); example: @test public void test() { tester mock = mockito.mock(tester.class); mockito.when(mock.selectgatewayinfoconfig(mockito.any(operation.class))).thenreturn("blah"); system.out.println(mock.selectgatewayinfoconfig(null)); } class operation<t> { } class tester { public string selectgatewayinfoconfig(operation<?> o) { return "hi"; } }

ios - TableView rows re-ordering unexpectedly -

i having problem uitableview not preserving row order when row's come on screen. after scrolling down/up order messed up. row index 1 in row 5's position , on. how keep row positions constant? internal func tableview( tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath ) -> uitableviewcell { var cell:uitableviewcell? = tableview.dequeuereusablecellwithidentifier( "cell" ) as? uitableviewcell if cell == nil { cell = uitableviewcell(style: uitableviewcellstyle.subtitle, reuseidentifier: "cell" ) // set cell's label cell?.textlabel?.text = "cell: \(indexpath.row)" } // return cell return cell! } what doing wrong? you setting text when creating cell (when dequeuereusablecellwithidentifier returns nil ). should set/change text each time create or reuse cell: internal func tableview( tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath ) -> ui

sorting - pandas groupby sort descending order -

pandas groupby default sort. i'd change sort order. how can this? i'm guessing can't apply sort method returned groupby object. do groupby, , use reset_index() make dataframe. sort. grouped = df.groupby('mygroups').sum().reset_index() grouped.sort_values('mygroups', ascending=false)

sql - MySQL query to retrieve only keywords using title case from text -

this question has answer here: mysql case sensitive query 3 answers i have table column in database table called keywordtext contains text in lower case, e.g. word global . however, if need include keywords in title or upper case, these must distinct lower case keywords, global not same global . typically, mysql select * keyword keywordtext = 'global' returns 2 results, i.e. global , global . but can suggest way return global ? don't think including like binary in query because return other unigram or bigram keywords such global networking . apologies duplication of previous questions. to case sensitive query need binary compares each byte of information. example: select * `table` binary `column` = 'value'

android - AudioSource.VOICE_COMMUNICATION doesn't work on all devices which are support VOICE_COMMUNICATION -

i use audiosource.voice_communication source in audiorecord instance devices support this. works on tablets except one. "acer iconia tab 8" . acousticechocanceler, automaticgaincontrol, noisesuppressor available. android version 4.4.2 the receiving device audio data buzzing . if use audiosource.mic used on fallback devices not support audiosource.voice_communication works, without echocancelation needed , should supported device. final int bufsize = math.max(1 * 2 * 8000, audiorecord.getminbuffersize(8000, audioformat.channel_in_mono, audioformat.encoding_pcm_16bit)); audiorecord rec; try { final int src = mediarecorder.audiosource.voice_communication; rec = new audiorecord(src, 8000, audioformat.channel_in_mono, audioformat.encoding_pcm_16bit, bufsize); } catch (illegalargumentexception e) { log.d("audiorecorder", "echo cancellation not enabled (old android version)"); final int src = mediarecorder.audiosource.mic; rec

android - Difference between Arduino mega Vs Arduino Uno -

what should better choice buy aruino board. concept desktop output given android device through internet , out arduino board via usb cable , board gives out run motors. thanks in advance..! the major differences things number of pins , memory sizes. here list: http://arduino.cc/en/products.compare the uno run programs need , compact. go further if have more pins requirements. i can't add below since says topic closed: if motors small , thinking of running them or few doctor pins instead of outside supply need aware of current capacities http://playground.arduino.cc/main/arduinopincurrentlimitations sounds uno fine unless need more current. the easiest way add android support on wi-fi or bluetooth shield can add uno.

java - TestNG runs no test from console -

i installed netbeans 8.0.1 on computer , used create test suite : <?xml version='1.0' encoding='utf-8' ?> <!doctype suite system "http://testng.org/testng-1.0.dtd" > <suite name="testing"> <test name="suite"> <packages> <package name="mypackage.tests"/> </packages> </test> </suite> in mypackage.tests there test class, simple 1 : [package, imports] public class tests001 { public tests001 () { } @test public void fail() { assertfalse(true); } in netbeans, launched test right-clicking the.xml file , selecting 'test file'. works - or rather, correctly fails - intended result now. but need launch console, run : > java org.testng.testng testing.xml and : =============================================== testing total tests run: 0, failures: 0, skips: 0 =============================================== no test run

Javascript and php Round Up decimals -

i having values 7030.56,5875.78,8852.67. want round value when .7 , above come on after decimal point. eg i want round when coming this: (i) 5875.78 -rounded value 5876 (i) 8978.78 -rounded value 8979 i dont want round when coming this: (i) 5875.58 -rounded value 5875.58 (i) 8978.68 -rounded value 8978.68 i want implement client side , server side also.php , javascript also. then have implement own logic. an example: $num number php: $fraction = $num - floor($num); if($fraction >= 0.7) { $result = ceil($num); }else{ $result = $num; } javascript: var fraction = num - math.floor(num); var result = num; if(fraction >= 0.7) { result = math.ceil(num); }

javascript - Making a navbar disappear -

i hope question have not been asked before. first of all, wanted navbar appear after specific number of pixels , found that: <script type="text/javascript"> (function($) { $(document).ready(function(){ $(window).scroll(function(){ if ($(this).scrolltop() > 725) { $('#nav-principale').fadein(500); } else { $('#nav-principale').fadeout(500); } }); }); })(jquery); </script> and worked. now, i'm looking way make navbar, fixed @ top of screen, disappear, if it's possible, after specific number of pixels. it might easy, have no knowledge in javascript/jquery. thanks help, zhyrmar try jquery: <script type="text/javascript"> $(document).ready(function() { $(window).scroll(function(){ if (($(this).scrolltop() > 725) && ($(this).scrolltop() < 1025)) { $('#nav-principale

pycharm - python - generate combinations (itertools)? -

can please give me hint put me on right path. i need write python code come combinations solve following: need generate possible letter combinations. there 6 letters. letters can in each position e.g. the first character can letters or t (2 possibilities) the second character can a, t or c (3 possibilities) the third character can g or t (2 possibilities) the fourth character can a, t, c or g (4 possibilities) the fifth character can c, g or t (3 possibilities) the sixth character can b a, or t (2 possibilities) i think should use python itertools examples have looked @ have fixed number of options available (in case letters) each position whereas letters available vary per position. any appreciated. you want use itertools.product task you need create list of lists each possible value: import itertools l = [ ['a','t'], ['a','t','c'], ['g','t'], ['a','t&#

lucene - How to do proximity search between phrases in SOLR? -

how can "x m" , "z k" in distance of 10 words or so? i saw in word level "foo bar"~4 ( proximity link ) can proximity search in pharses level , not in word level ? if don't mind being bit looser on matching, this: "x m z k"~10 . match want. would, however, match other things like: "x a m z a k". if can tolerate that, there easy answer. might edismax query parser's pf2 , ps2 parameters, see if can use close enough. the surround query parser , way, designed around using spanqueries. seems query like: {!surround} 10w(1n(x, m), 1n(z, k)) work here, seems surround doesn't support nested parentheses, unless i'm missing something. if aren't adequate needs, believe need build query through lucene api directly, rather through solr query syntax. combination of spanquery s job, like: spanquery termx = new spantermquery(new term("fieldname", "x")); spanquery termm = new spant

Java X Delphi Integration - Delphi cannot call Java 8.25 -

i have delphi project calls java.exe performe functions using following code: shellexecute(0, 'open', pchar('java.exe'), pchar(parameters), pchar(javapath), sw_hide); where: javapath , parameters string variables. this working fine along last 6 months. last java version (jre 8.25), broked. i have tried use javaw.exe, not work too. can me? maybe indicating new way javaxdelphi integration. regards.

java - How do you send call to main class from a class file? -

hi have 1 main program file 2 class files involved in this. in main class file create frame , control how interact. 1 of class files needs talk main class file change 3rd file. trying go find out how call sent back. the main class file: public class mainframe extends javax.swing.jframe { public mainframe() { buttonpanel1 = new buttonpanel(); textpanel1 = new textpanel(); textpanel2 = new textpanel(); setdefaultcloseoperation(javax.swing.windowconstants.exit_on_close); javax.swing.grouplayout layout = new javax.swing.grouplayout(getcontentpane()); getcontentpane().setlayout(layout); layout.sethorizontalgroup( layout.createparallelgroup(javax.swing.grouplayout.alignment.leading) .addgroup(layout.createsequentialgroup() .addgroup(layout.createparallelgroup(javax.swing.grouplayout.alignment.leading, false) .addcomponent(buttonpanel1, javax.swing.grouplayout.default_size, javax.swing.grouplayout.default_size,

jasper reports - subreport in Detail band getting displayed repeatedly -

i have subreport included in detail band of parent report. sql query in parent report returns multiple rows. , subreport gets displayed many times records returned parent sql query. want display subreport once irrespective of records returned sql query in parent report. have tried moving subreport columnfooter section "subreport overflowed on band not support overflow" error. pointers working helpful. ok start with: subreport has different dataset (sql query) parent report. if use query, subreport shown many times there records result of query. it's meant , that's same parent reports. what want achieve if unerstand correctly, have supreport outputted once , main report outputted many times there records returned. suggest is: why don't turn around? solve problems , use programm how it's meant to. can this: put query returns mulptiple record in subreport, change layout matches current parent report. put data should displayed once in parent

Navigating Excel Document when Form is Active -

answer: change userform property "showmodal" false. found answer here. http://www.mrexcel.com/forum/excel-questions/383493-allow-application-scrolling-behind-userform.html the form disables navigation excel document. cannot scroll, click, or move around @ all. made buttons me that's pretty lame. i've googled i'm not using right terms. what can enable navigation document while form visible , active? "try setting userform property 'showmodal' false. allow interact sheet while keeping userform visible." http://www.mrexcel.com/forum/excel-questions/383493-allow-application-scrolling-behind-userform.html there is...just tried different googling.

if statement - Mobile redirect using jquery -

mobile redirect jquery today ask first question here since need little code , idea.... my first problem if in first part of code, should ask device-desktop true , search in tabletbox existing p , executing code refresh in tablet-view. somehow doesnt while both conditions should valid guess mistake in if-code, got fix? my next problem referring url , place "?uselayout=tablet" behind it. the final function should work this: script asks if (device.tablet) in case true, ask if division exists on tablet-layout not loaded, if both conditions valid should referrer url, put ?uselayout=tablet behind , reload. since division there after reload stop on every next pageload without refresh. if ((device.desktop()) && ($('.tabletbox').find('p').length > 0)) { console.log( "umleitung aktiv" ); window.location.replace("https://www.url.de/de/?uselayout=tablet");} else {console.log( "umleitung nicht-aktiv" );} update #

Quotation marks for non-string literals in MySQL statements -

i know string literals in mysql statements need included in single quotation marks this: select * my_table str_column='test' i wonder if there reason include non-string literals in such quotes, e.g. this: select * my_table int_column='1' instead of select * my_table int_column=1 does make sense include non-string literals single quotes? or waste of bytes? you're right, it's not necessary quote numeric literals. see done frequently. there's no downside quoting numeric literals. mysql converts them automatically numeric value when used in numeric context, example comparing int column or used in arithmetic expression. i believe common case when it's useful quoting numeric literals when you're interpolating application variables sql strings. for example: <?php $num = $_post['num']; $sql = "select * my_table int_column = $num"; // not safe! sql injection hazard! even if 'num' parameter expect

Data alignment in Excel or Matlab? -

Image
i carried out experiment , automatically got readings in .csv file format. apparatus supposed take reading every 0.1 seconds, , offline. apparatus kept counting didn't print these in csv file. example, go reading 98.5, 98.6, 99.0. i'm looking way put blank rows in there missing data, such it'll read 98.5, 98.6, 98.7, 98.8, 98.9, 99.0. , give values of nan these. doing individually isn't option, there vast amount of data (864,00 day). ideas on doing in excel or matlab? in matlab: it looks data has 1 decimal digit. in order avoid floating point errors , can multiply first column 10 , round it , create indices. (an alternative use ismemberf fileexchange). now, create matrix of nan s of desired size. after that, fill elements corresponding indices found. idx = round(a(:,1)*10); x = nan(max(idx)-min(idx),2); x(idx+1,:) = = 0 0.8147 0.1000 0.9058 0.5000 0.0975 0.6000 0.2785 0.7000 0.5469 0.8000 0.9575

apache - How to send a file to a server using curl? -

first off, know square root of sod curl , i'm not trying learn it. i'm told might me out tracking down problem in c code trying write data apache server. may barking completely wrong tree here. what want do http post laptop desktop running http server, see raw http using wireshark. can go c code on embedded board better idea of how working. i have tried following command: curl -x post -d @test.txt 192.168.0.106/incoming where text.txt contains "hello world" in plain text (created vim). .106 apache server...which serves files nicely command. but gives: warning: couldn't read data file "test.txt", makes empty post. <!doctype html public "-//ietf//dtd html 2.0//en"> <html><head> <title>301 moved permanently</title> </head><body> <h1>moved permanently</h1> <p>the document has moved <a href="http://192.168.0.106/incoming/">here</a>.</p> </body

wcf - Using an Attribute (IOperationBehavior) on all service methods -

i using following [trackingbehaviorattribute] custom ioperationinvoker on [operationcontract] , fine. but seek way able add attribute on interface level ([servicecontract] level). want avoid manual process of adding attribute on every method inside service. using system.reflection; using system.servicemodel; using system.servicemodel.description; using system.servicemodel.dispatcher; using system.servicemodel.channels; public class trackingbehaviorattribute : attribute, ioperationbehavior { #region ioperationbehavior members public void addbindingparameters(operationdescription operationdescription, bindingparametercollection bindingparameters) { } public void applyclientbehavior(operationdescription operationdescription, clientoperation clientoperation) { } public void validate(operationdescription operationdescription)

jboss - No theme found for specified theme id liferay -

i have been deploying custom theme no problems. on recent deploy liferay reverted default classic theme , had these errors in log: it doesn't unregister or register... 11:10:20,722 info [serverservice thread pool -- 254][pluginpackageutil:1049] reading plugin package new-theme 11:10:20,731 info [serverservice thread pool -- 254][themehotdeploylistener:129] unregistering themes new-theme 11:10:20,732 info [serverservice thread pool -- 254][themehotdeploylistener:164] 0 themes new-theme unregistered 11:10:21,081 info [serverservice thread pool -- 273][hotdeployimpl:185] deploying new-theme queue 11:10:21,082 info [serverservice thread pool -- 273][pluginpackageutil:1049] reading plugin package new-theme 11:10:21,148 info [serverservice thread pool -- 273][themehotdeploylistener:89] registering themes new-theme 11:10:21,232 info [serverservice thread pool -- 273][themehotdeploylistener:107] 0 themes new-theme available use there nothing else related theme deployment in logs

python - Template matching results when the template is not on the original image -

Image
for testing purposes i'm building bot clicks on buttons in screen. have folder possible buttons needs pressed , application being tested has 1 button shown @ time. there no situations 2 or more buttons appear on screen. my approach take screenshot every few seconds , loop through possible buttons , try find them on screenshot. if button found bot clicks center of button. my issue if button not present on screenshot template algorithm i'm using returns false positive somewhere in screen. there way make sure no false positives returned unless button exists on image? i'm using python numpy , skimage. template matching i'm using skimage.feature.match_template. i tried opencv using sift , things not success , lot of issues opencv itself. p.s.: if think there better way solve problem (testing app pressing buttons) welcome too. cheers edit 1: these images: edit 2: the output of script (false positive) as realised later on, way make sure dete

I don't understand the call to the parent class from within the class in this JAVA class -

can me understand why call parent class here? found download class seemed simple enough use wrapping brain around first method. public class downloadhandler { public static void main(string[] args) throws exception { downloadhandler d = new downloadhandler(); d.urlsetup(args[0]); } .... } i trying instantiate handler in loop , getting error. downloadhandler file = new downloadhandler("http://example.com/"+cleanlink+"/"+filename+".pdf") it says "downloadhandler() in downloadhandler cannot applied (java.lang.string)" your downloadhandler class has static void main method, single point of entry when executing command-line programs. that method not constructor. what initialize new instance of downloadhandler , invoking instance method on object passing given string argument. not sure what's usage there. in order initialization compile, want add constructor performs similar