Posts

Showing posts from March, 2012

java - can not read last column data from excel file -

i reading data excel file salary generation in column empcode, emp_name,working_days,overtime_hour when reading data excel file read first 3 column means read working days can not read overtime_hour please suggest wrong.i tried bellow code public class csv_upload extends jframe implements actionlistener { public static jframe f; jpanel panel; connection con = null; jbutton b1,b2,b3,b4; int status=0; jtextfield txt1; int company_id1=0; jlabel l1; font g,g1; jfilechooser fc; jtextarea log; file file1 ; string str; jcombobox jb1; public csv_upload() { panel=(jpanel)getcontentpane(); panel.setlayout(null); g=new font("georgia",font.bold,22); g1=new font("georgia",font.bold,15); panel.setbackground(new java.awt.color(204, 230 , 255)); l1=new jlabe...

css3 - css image autoresize not working -

i trying 2 columns : one div called words , other ul called snaps has li of images currently when resize images instead of resizing moves next row...how them resize based on screen width below example <div class="main"> <div class="subfooter"> <div class="words"> test messgae </div> <ul class="snaps"> <li><img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:and9gcr6hip-1dv221es0hk1e9ouqmzcavdw51paj4t0-zrzfxkgxmuxfa"/></li> <li><img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:and9gcr6hip-1dv221es0hk1e9ouqmzcavdw51paj4t0-zrzfxkgxmuxfa" /></li> <li><img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:and9gcr6hip-1dv221es0hk1e9ouqmzcavdw51paj4t0-zrzfxkgxmuxfa"/></li> <li><img src="https://encrypted-tbn2.gstatic.com/images?q=...

codeigniter - Calling a method in controller from a model -

is possible call method in controller model? if ($this->db->trans_status() === true) { //calling method in controller } if need that, there's wrong design. controller responsible happens in view (template). model responsible manipulating , retrieving records database. as general rule, if function going used in more 1 template, put in model. otherwise, goes in controller. the model should not know controllers. maybe redesign of system more appropriate in case. here link similar thread .

ember.js - How to work with global query params -

i have query params don't want loose when switch 1 route another. docs, solution seems use of global query params, set on applicationcontroller . let's setup : a page list of objects displayed , criterias on left filter list. may call related controller listcontroller . criterias have query params. when object first page clicked, whole page replaced detailed view of object. page need able go filtered list , consequently keep query params. i need access applicationcontroller 's global query params listcontroller manipulations. it's easy : app.listcontroller = app.arraycontroller.extend({ needs: "application", qp: ember.computed.alias("controllers.application"), .... when criteria changes, filtering operation done server side, need refresh listroute when query params changes. how applicationroute ? app.applicationroute = ember.route.extend({ actions: { queryparamsdidchange: function () { var listroute ...

android - Could not find actionbarsherlock.apk in Navigation Drawer Page Sliding Tab Strip -

i have download 3 files related navigation drawer page sliding tab strip . , now, it showing error : actionbarsherlock] not find actionbarsherlock.apk! pagerslidingtab] not find pagerslidingtab.apk! i have followed steps per link : managing projects eclipse but after getting error : conversion dalvik format failed: unable execute dex: multiple dex files define landroid/support/v4/accessibilityservice/accessibilityserviceinfocompat$accessibilityserviceinfoversionimpl; by tutorials, have solved issue getting error : classnotfound exception though there in androidmanifest . how solve problem ?

computation - Identifying colluding nodes in a distributed computing environment -

i have distributed environment in computations carried out in parallel in same form of map reduce paradigm. want know if there result verification scheme such computations. have read basic method replicate computation in multiple worker nodes. in such method, hash value of computation returned worker nodes. hash value compared identify if result correct. method not prevent collusion in malicious nodes might communicate each other , return same result. there method available thwart collusion. there several collusion detection algorithms, i've not been able find algorithm identifies colluding group of nodes malicious. kindly give me insight on solution. sounds you're trying solve byzantine generals problem . the essence of solution problem problem (and linked paper) is: the method of having 1 general simulate m others can used prove no solution fewer 3m + 1 generals can cope m traitors. proof similar 1 original byzantine generals problem , left reader...

javascript - Julia set rendering code not working -

i'm working on mandelbrot , julia set renderer in javascript. done mandelbrot set, , assumed julia sets natural extension of that. however, current implementation of julia sets seems not working. have following: for(var row=0; row < height; row ++) { for(var col=0; col < width; col ++) { var re = parsefloat(document.getelementbyid("jul_0").value); var im = parsefloat(document.getelementbyid("jul_1").value); var x = (col - width/2)*4.0/width; var y = (row - height/2)*4.0/width; var iterations = 0; while(((x*x + y*y) <= 4) && (iterations < max)) { var tmp = x*x - y*y + re; y = 2*x*y - im; x = tmp; iterations ++; } if(iterations < max) { ctx.fillstyle = colors[iterations]; ctx.fillrect(col, row, 1, 1); } else { ctx.fillstyle = "#000000"; ctx.fill...

mysql - PHP Globally visible login -

i went through quite few articles , couldnt find looking for. have tried using $globals doesnt work when querying mysql. the problem have here want username visible on entire page , php files included after username , password confirmed on login screen. example of mean (password hashing removed simplification): <?php include('config.php'); global $logged; $email = $_post["email"]; $globals['email'] = $email; $password = $_post["password"]; $results = sqlquery("select upassword usertable useremail='$email' limit 1"); foreach ($results $result) { $cpassword = $result[0][0]; } if($cpassword === $password) { echo "login succesful"; $logged = 0; redirect('index.php', false); } else { $logged = 1; echo "incorrect username or password"; } ?> ============================== function sqlquery($sql) { global $db_conn; // execute query $db_result = mysql_query($sq...

iphone - Sending Push notification through pushwoosh from php -

i trying send push notification through push woosh such : is me how send push notification on device code function pwcall( 'createmessage' , array( 'application' => pw_application, 'auth' => pw_auth, "devices" => pw_devicetoken, 'notifications' => array( 'send_date' =>'now', //gmdate('d-m-y h:i', strtotime('2014-04-07 20:35')), 'content' => 'my custom notification testing ', 'link' => 'http://pushwoosh.com/', 'content' => array("en" => "english","ru" =>"Русский","de"=>"deutsch") ), 'page_id' => 16863, 'link' => 'http://google.com', 'data' => a...

postgresql - postgres query error for GROUP BY clause -

i have table login_logout time id user_id start end total(sec) -------------------------------------------------------------------------------------- 1 1 "2014-04-14 12:17:54.772" "2014-04-14 12:17:55.772" 1 2 1 "2014-04-14 12:22:41.763" "2014-04-14 12:31:14.295" 512 3 2 "2014-04-14 12:43:51.823" "2014-04-14 12:48:40.706" 288 4 2 "2014-04-14 13:22:51.656" "2014-04-14 13:22:52.656" 1 i want data in format user : 1 ------------------------------------------------------------------ start_time end_time total (seconds) "12:17" "12:17" 1 "12:22" "12:31" 512 total: 513 user : 2 ------------------------------------------------------------------ "12:43" "12:...

html - Force images to be next to each other -

i have 4 images want next each other no matter what. when windows not wide enough overflowing images in next line. how can prevent that? tried "inline", "inline-block" , "inline-table" happens everytime. images width aren't fixed, depend on height of window, setting min-width not possible. , don't want put them single image. thank julian wrap them in div , give div min-width of sum of images' widths.

java - Using regular expressions to rename a string -

in java, want rename string ends ".mp4" suppose have encoded link, looking follows: string link = www.somehost.com/linkthatineed.mp4?e=13974etc... so, how rename link string ends ".mp4"? link = www.somehost.com/linkthatineed.mp4 <--- that's need final string be. another way split string ".mp4" split char , add again :) something : string splitchar = ".mp4"; string link = "www.somehost.com/linkthatineed.mp4?e=13974etcrezkhjk" string finalstr = link.split(splitchar)[0] + splitchar; easy ^^ ps: prefer pass regex ask more knowledge regex ^^

asp.net - Multiple argument for a WCF web service -

i want create wcf webservice create user . implemented service , interface : [operationcontract] [webinvoke(method="post" ,uritemplate = "adduser/{id}/{login}/{pwd}/{prenom}/{nom}/{email}")] void adduser(string id ,string login ,string pwd ,string prenom ,string nom ,string email); and implementation of service : public void adduser(string id, string login, string pwd, string prenom, string nom, string email) { int userid = convert.toint32(id); using (entities entities = new entities()) { usr user = new usr(); user.cin = userid; user.login = login; user.pwd = pwd; user.prenom = prenom; user.nom = nom; user.email = email; entities.users.add(user); entities.savechanges(); } } this web config <services> <service name="pfewebservices.projectwebservices" behaviorconfiguration="servicebe...

php - Drupal Calendar - How to change week layout? -

Image
i need change calendar week view, more user friendly. please check screenshot, explaining goal reach on it: https://www.diigo.com/item/image/4otf9/eb3r https://www.diigo.com/item/image/4otf9/1qcb the website has dates events, during night. so, there events starting @ 2am exemple. doesn't make sense displaying these events in next day. exemple, if party starts on saturday night @ 2am, me confusing user display on sunday.. how can adapt week templates start day @ 5am (instead 00:00) , finish @ 24:00 (instead 24:00) and multi-day dates, how display them next single day dates?? change settings of calendar format in views , set time grouping custom . in box, specify intervals/start times want show starting @ hour want start at. see illustration below: you can change week display too.

python - Append results of arcpy.TableToTable_conversion to same table -

how can 1 append results of arcpy.tabletotable_conversion() same table when reading multiple tables? thanks. lf = arcpy.listfiles() files = 0 f in lf: files +=1 arcpy.tabletotable_conversion(f, out_path, "usps") print f print arcpy.getmessages() what using append ? either after each conversion or better, outside loop, tables @ once.

javascript - Why does a RegExp with global flag give wrong results? -

what problem regular expression when use global flag , case insensitive flag? query user generated input. result should [true, true]. var query = 'foo b'; var re = new regexp(query, 'gi'); var result = []; result.push(re.test('foo bar')); result.push(re.test('foo bar')); // result [true, false] var reg = /^a$/g; for(i = 0; i++ < 10;) console.log(reg.test("a")); the regexp object keeps track of lastindex match occurred, on subsequent matches start last used index, instead of 0. take look: var query = 'foo b'; var re = new regexp(query, 'gi'); var result = []; result.push(re.test('foo bar')); alert(re.lastindex); result.push(re.test('foo bar')); if don't want manually reset lastindex 0 after every test, remove g flag. here's algorithm specs dictate (section 15.10.6.2): regexp.prototype.exec(string) performs regular expression match of string ag...

javascript - Using options with cloud zoom plugin -

how use options cloud zoom plugin. website http://www.starplugins.com/cloudzoom/examples . need acheive innerzoom example. this javascript code using call plugin, how modify code achieve example <!-- call quick start function. --> <script type="text/javascript"> cloudzoom.quickstart(); </script> i don't know cloud zoom, try like: <script type="text/javascript"> cloudzoom.quickstart({ zoomposition: 'inside', autoinside: true }); </script> inspecting demo-site, figured out used data-attributes on examples: <img alt="cloud zoom small image" data-cloudzoom=" zoomimage:'/sites/starplugins/images/jetzoom/large/image7.jpg', zoomposition:'inside', zoomoffsetx:0 " src="/sites/starplugins/images/jetzoom/small/image7.jpg" class="cloudzoom"> have tried data-attribs?

javascript - Hide bubble in nvd3 bubble chart -

i using nvd3 bubble chart . want hide bubble contains size:0; i have 2 data :- var data = []; data.push({key: 'male(yes)', values: []}); data['0'].values.push({ x: 1 , y: 1 , size: 0 }); data.push({key: 'male(no)', values: []}); data['1'].values.push({ x: -1 , y: -1 , size: 20 }); i don't want show bubble has size:0;. how can hide bubble? you can applying css style (visibility:hidden/display:none/opacity:0) individual data point. 1 way of doing select svg objects of type point - depending on names used , filter them according size, apply new style them. svg.selectall("#yourname svg") .filter(function (l) { return l.size== 0; })[0].foreach(function (d){ d.style("visibility","hidden") })

Microsoft Visual Studio Express 2013 for Web with Update 2 RC - got no Typescript installaaion -

sorry, microsoft visual studio express 2013 web 12.0.30324.00 update 2 rc doesn't offer typescript me. (have installed 2 rc) anny suggestioms? i thoroughly have looked other answers, telling each item while creating new web / adding new item project. please tell well, me if has same problem. thank you there's no template for reason, if add new file project, , use .ts extension, typescript compiler should work when save file. in update 2 rc, visual studio doesn't show file being nested anymore either. it's "ts" file.

matlab - Get index position of where vector changes value -

i have vector contains list of strings ordered. know index number of vector changes. below clear example. not use matlab much. in head i'm thinking of using loop. wondering if there better way of doing using matlab? vector abc abc abc abc mnk mnk mnk plo plo so know abc 1:4, mnk 5 : 7 & plo 8 : 9 one approach - %%// input a1 = { 'abc' 'abc' 'abc' 'abc' 'mnk' 'mnk' 'mnk' 'plo' 'plo'}; [val,x2] = unique(a1,'first'); [~,x12] = unique(a1); %%// default takes last unique value out = [val num2cell(x2) num2cell(x12)] output - out = 'abc' [1] [4] 'mnk' [5] [7] 'plo' [8] [9]

ios - Is is safe to modify readonly NSData via pointer address? -

i want perform xor operation nsdata below, safe modify readonly nsdata (non arc)? have tried, did work. @implementation nsdata (additions) - (void)xorwithbytekey:(byte)keybyte { char *curdataptr = (char *)self.bytes; (int x = 0; x < self.length; x++) { *curdataptr = *curdataptr ^ keybyte; curdataptr++; } } @end from @ cfdata source code doing seems safe. had quick search references _bytes (which accessing directly) , nothing jumped @ me. though want take risk of relying on such implementation detail? costly in code go via nsmutabledata copy of data , modify instead? as in category (warning, untested): @interface nsdata (xoring) - (nsdata *) xorwithbytekey: (byte) b ; @end @implementation nsdata (xoring) - (nsdata *) xorwithbytekey: (byte) b { nsmutabledata * copy = [self mutablecopy] ; char *p = (char *)copy.bytes; (nsuinteger = 0, length = copy.length ; < length; ...

javascript - How to preload specific area of Google Map? -

let's open map: https://www.google.com.au/maps/@-33.8654593,151.2082297,15z when pan, see map being loaded. it's of course better now, maps vectors drawn in canvas element. still need wait while. the same happens when use panto method of map object in google maps api ( docs ). , problem. want pan using javascript area of google map preloaded, user see whole view sharp when animating. is there way specify region of map preload don't see loading? no, unfortunately there no way part of javascript api.

How to get facebook user's name,id and email with just it's facebook id? ( c++ ) -

i using marmalade c++ , need facebook user name, picture, , email , have facebook user id. i using example , worked until need way @ least search or somehow need because don't know do. http://api.madewithmarmalade.com/examples3efacebook.html is there way i'm not seeing user name , picture or need other class , facebook stuff that? i don't know marmalade framework, know can't email address user if don't have user access token enable user_email permission. i guess use s3efbrequest_withgraphpath method ( http://api.madewithmarmalade.com/group__facebookapigroup.html#gaca80d12f6a25a19619b222af6bc3d290 ) pass following path: /{user_id}?fields=name,picture where {user_id} user_id.

Difficulty using BufferedImage in Eclipse -

i have stored image in resource folder 'images': src -com.program -images in program use bufferedimage image =imageio.read(getclass().getresourceasstream("/myimage.png")); to import image. this works fine. however, if change name of image @ source(say myimage1.png) , try execute bufferedimage image =imageio.read(getclass().getresourceasstream("/myimage1.png")); i input==null. i've been try work while , tried various suggestions on other threads. ideas? thanks! the problem likely: the image in src folder inside project, when program runs, runs folder containing compiled classes. folder did not contain png , input == null exception ( getclass().getresourceasstream(...) returns null when resources cannot resolved). to make work, need mark images folder resource folder (using eclipse, maven or favorite build tool), , make sure contents of folder on class path when program run.

c - strcpy and string presentation in memory -

i have program this(x86_64 gnu/linux) int main() { char s[] = "123456789"; char d[] = "123"; strcpy(d, s); printf("%p, %0p\n", s, d); printf("%s, %s", s, d); return 0; } and output : 0xeb6d2930 0xeb6d2910 123456789 123456789 little confused result think program in memory this: '9','\0' . . '5','6','7','8' 0x7fff813af310: '1','2','3','4' 0x7fff813af300: '1','2','3','\0' so result should *s = "789", *d = "123456789" could guys explain why result isn't thought? changed format specifier %p print address of d , s know s , d overlapped there not enough space d hold s may lead undefined behaviour,but anyway wondering why result *s = "123456789" *d = "123456789" from output show address layout , it's initial content seem ...

sql - How does one import/incorporate just the blog section of a WordPress site? -

Image
i'm in process of re-coding client's website. current site using wordpress blog only; rest of website hand-coded php. entire new site utilizing wordpress. my question is, how import existing blog database current wordpress setup? in other words, i've installed fresh wordpress new website's directory, , added bunch of pages , custom post types. have import of blog posts , comments old site, i'm afraid of overwriting in new database. how can import posts , comments without altering i've completed? thank insight can provide. you can doing following steps: 1) go old wp admin panel , click tools > export , on opening page select post options , click export 2) after export xml, go new wp site admin panel , click tools > import . if first time import, see selection page importer. select wordpress , install wordpress importer 3) near complete. open wordpress importer , upload xml file have export , downloaded old wp site. that...

c++ - OpenCV calibrateCamera assertation failed -

few days i'm fighting camera calibration chessboard example. going fine (corners found , displayed, feed arrays) till call final function calibratecamera. assertation error: opencv error: assertion failed (nimages > 0) in calibratecamera, file /home/ig/downloads/opencv-2.4.8/modules/calib3d/src/calibration.cpp, line 3415 here classic code: #include <iostream> #include <fstream> #include <vector> #include "opencv2/core/core.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/imgproc/imgproc.hpp" using namespace cv; using namespace std; int main(int argc, char* argv[]) { videocapture captr(0); // open video camera no. 0 (right) if (!captr.isopened()) // if not success, exit program { cout << "cannot open video cam 0" << endl; return -1; } ...

objective c - iOS socket list of hosts wlan -

i have wlan-device, communicate with. @ first go ios settings , connect device directly. in app need input ip , port open socket. until knew ip , port, open socket connection device. if connected (adhoc) device, why can not find stuff automatically? saw solutions, of them need usage of dynamic libs or not longer available in ios7.1. can not use dynamic libs, because app should go appstore. there no other way since ios 6. have scan location. "reachability" you, if know name of host. try scan posible ip's. thread limited 5 operations go preaty fast.

How similar is print command in R to printf in C -

how similar print command in r printf in c? want write command printf(%s, variable) in r? suggestions how that? my code: v <- "abc" print(sprintf(%s, v) error: unexpected input in "print(sprintf(%s, v)" you have 2 errors: r> v <- "abc" r> print(sprintf("%s", v)) [1] "abc" the first not write format string string in quotes. second missing closing parenthesis. but want argument cat() want end newline in 1 of 2 places: r> cat(sprintf("%s", v), "\n") abc r> cat(sprintf("%s\n", v)) abc r>

Convert video to exactly the same stream type of other video in ffmpeg -

maybe silly question, didn't manage find clear answer anywhere. i need use ffmpeg convert given video same format video has, including bitrate, video , audio codecs... everything. goal concat both videos single file, independently of original formats. is there easy way or have build complex command line input specifying parameters? the concat demuxer not enough... maybe filter_complex? thanks , sorry bother.

jquery - Make a progress bar vertical in new bootstrap -

so have 5 progress bar in boostrap animated(when load page) make vertical code <div class="progress progress-striped active"> <div class="progress"> <div class="progress-bar six-sec-ease-in-out" aria-valuetransitiongoal="20"></div> </div> </div> <div class="progress progress-striped active"> <div class="progress"> <div class="progress-bar progress-bar-info six-sec-ease-in-out" aria-valuetransitiongoal="40"></div> </div> </div> this custom boostrap code .progress .progress-bar.six-sec-ease-in-out { -webkit-transition: width 6s ease-in-out; -moz-transition: width 6s ease-in-out; -ms-transition: width 6s ease-in-out; -o-transition: width 6s ease-in-out; transition: width 6s ease-in-out; } and animation used <script type="text/javascript"> $(...

c++ - Why does "most important const" have to be const? -

in http://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/ mentions "most important const" c++ deliberately specifies binding temporary object reference const on stack lengthens lifetime of temporary lifetime of reference itself. wondering why c++ allows lifetime of object lengthened when reference const , not when isn't? rational behind feature , why have const? here's example: void square(int &x) { x = x * x; } int main() { float f = 3.0f; square(f); std::cout << f << '\n'; } if temporaries bind non-const lvalue references, above happily compile, produce rather surprising results (an output of 3 instead of 9 ).

sql server - Installing MDS Excel Add-In Issue with Prerequisites -

Image
i attempting install master data services plugin excel , can't install process due saying prerequisites not installed: i have made sure have right version (32 bit) match version of excel (2010), , have full version of .net 4.5 installed. if try install full version of .net 4.0, told newer (4.5) version installed. here links similar issues, no response: microsoft answers ; microsoft connect ; has else faced issue , got around it? so, looks simple fix. installer needs run administrator, in order have run through command prompt administrator. after doing this, installed ok. i'm not sure why installer didn't request elevated privileges, i'm guessing couldn't query system verify necessary prerequisites installed. hopefully helps else in future!

scroll - How do I prevent the page from scrolling when I zoom on a Google Map in Chrome? -

i using mac trackpad on google map. if two-finger swipe down or up, map zooms in or out (like should), entire page scrolls or down. i think has trackpad momentum (probably same on magic mouse). when use normal mouse scroll wheel, don't have same problem. i have tried doing things e.preventdefault() in scroll listener of map element, no luck. to see example, zoom in or out fast on google's own demo page: https://developers.google.com/maps/documentation/javascript/examples/map-simple how prevent entire page scrolling when trying zoom map? thank you! with jquery try this: $("#idofmap").on("wheel mousewheel dommousescroll", function(e){ e.preventdefault(); }); when using jquery prior 1.7 use bind() instead of on() .

c++ - std::vector::assign - reallocates the data? -

i working stl library , goal minimize data reallocation cases. wndering, std::vector::assign(size_type n, const value_type& val) reallocated data if size not changed or assign new values (for example, using operator=) ? the stl documentation @ http://www.cplusplus.com/ sais following (c++98): in fill version (2), new contents n elements, each initialized copy of val. if reallocation happens,the storage needed allocated using internal allocator. any elements held in container before call destroyed , replaced newly constructed elements (no assignments of elements take place). causes automatic reallocation of allocated storage space if -and if- new vector size surpasses current vector capacity. the phrase "no assignments of elements take place" make little confusing. so example, want have vector of classes (for example, cv::vec3i of opencv). mean, that the destructor or constructor of cv::vec3i called? a direct copy of vec3i memory made...

ms access - [] brackets in sql statements -

what brackets in sql statement? for example, in statement: insert table1 ([columnname1], columnname2) values (val1, val2) also, if table name in brackets? the [] marks delimitation of identifier, if have column name contains spaces order qty need enclose [] like: select [order qty] [client sales] they escape reserved keywords used identifiers

c++ - Why is the copy constructor being used instead of the assignment operator -

this how myclass defined: class myclass { double x, y; public: myclass (double = 0., double b = 0.) { x = a; y = b; cout << "using default constructor" << endl; } myclass (const myclass& p) { x = p.x; y = p.y; cout << "using copy constructor" << endl; } myclass operator =(const myclass& p) { x = p.x; y = p.y; cout << "using assignment operator" << endl; return *this; } }; and tested when each constructor or method called in main program: int main() { cout << "myclass p" << endl; myclass p; cout << endl; cout << "myclass r(3.4)" << endl; myclass r(3.4); cout << endl; cout << "myclass s(r)" << endl; myclass s(r); cout << endl; cout ...

java - jniavutil.dll: Can't find dependent libraries -

when run code following link, https://github.com/sagioto/lipreading/blob/master/lipreading-gui/src/main/java/edu/lipreading/gui/mainframe.java ; following error : exception in thread "thread-6" java.lang.unsatisfiedlinkerror: c:\users\harish ram\appdata\local\temp\javacpp13384533628877\jniavutil.dll: can't find dependent libraries @ java.lang.classloader$nativelibrary.load(native method) @ java.lang.classloader.loadlibrary1(unknown source) @ java.lang.classloader.loadlibrary0(unknown source) @ java.lang.classloader.loadlibrary(unknown source) @ java.lang.runtime.load0(unknown source) @ java.lang.system.load(unknown source) @ com.googlecode.javacpp.loader.loadlibrary(loader.java:418) @ com.googlecode.javacpp.loader.load(loader.java:368) @ com.googlecode.javacpp.loader.load(loader.java:315) @ com.googlecode.javacv.cpp.avutil.(avutil.java:75) @ java.lang.class.forname0(native method) @ java.lan...

c# - How to serialize the object of type DateTimeFormatInfo? -

i want serialize object of type datetimeformatinfo. i tried following code: datetimeformatinfo datetimeformat = new datetimeformatinfo(); datetimeformat.shortdatepattern = "dd-mmm-yy"; xs = new xmlserializer(datetimeformat.gettype()); streamwriter sw = new streamwriter("setting.xml"); xs.serialize(sw, datetimeformat); but throws below exception. system.invalidoperationexception unhandled. there error generating xml document. type system.globalization.gregoriancalendar not expected. use xmlinclude or soapinclude attribute specify types not known statically. is need add serializing datetimeformatinfo? you need include in xmlserializer list of addictional object types serialize. in case, need add object type system.globalization.gregoriancalendar . system.globalization.datetimeformatinfo datetimeformat = new system.globalization.datetimeformatinfo(); datetimeformat.shortdatepattern = "dd-mmm-yy"; ...

Prerequisites for using C# 6 Roslyn -

there's lot of buzz around c# 6 however, wanted know if work in asp.net , asp.net mvc? i mean, c# 6 cannot run in framework 4.5 ( or can it? ) should use c# 6 backend of asp.net/(mvc), because doesn't have private servers. so, should wait hosters godaddy upgrade system, before use anticipated c# 6? the preview-release of c# 6.0 compiler - compiler. doesn't target new version of .net framework. such, there's nothing new needs installed on server - compile code new compiler, upload it, , you're done. of course, doesn't mean features available if you're not using sufficiently up-to-date version of .net - if you're targeting .net 2.0, don't use linq since introduced in .net 3.5. also, lot of features you've heard "buzz" haven't been implemented yet, in preview-release. they're planned , that's all. if there's particular feature you've heard you're wanting make use of, should check whether it...

java - Trying to create a palindrome...how can I compare the "output.charAt(k)" to original "output" String? -

public static void main(string[] args) { string input = new string(joptionpane.showinputdialog("enter string.")); string inputlow = input.tolowercase(); string output = ""; //blank string for(int = 0; < inputlow.length(); i++) //for loop continue through entered string { if(inputlow.charat(i) >= 'a' && inputlow.charat(i) <= 'z') //if statement check appropriate characters { output += inputlow.charat(i); //add appropriate characters string output ('a' - 'z') } } system.out.println(output); //getting reverse string int n = output.length() - 1; string last = ""; for(int k = n; k >= 0; k--) { system.out.print(output.charat(k)); //last = string.valueof(output.charat(k)); } //system.out.println(""); //system.out.println(last); } so trying print string last when un-comment code ou...

ruby on rails - Factory Girl associations undefined method for what's supposed to be an association -

i'm trying create error 2 factorygirl models. have cars , car manufacturers. cars belong car manufacturers foreign key/variable belongs in car. when run tests, error. failure/error: car = factorygirl.build(:car) nomethoderror: undefined method `car_manufacturer=' #<car:0x0000010437a7d0> here factories located in spec/factories folder factorygirl.define factory :car color 'black' year 2012 mileage 50000 description 'badass used car' car_manufacturer end end factorygirl.define factory :car_manufacturer name 'speed racer inc.' country 'japan' end end i don't have set in associations validations because understood, factory girl seperate should work. perhaps wrong in spec: scenario 'i want associate car car manufacturer' car_manufacturer = factorygirl.create(:car_manufacturer) car = factorygirl.build(:car) car_count = car.count visit new_car_path fill_in 'color', with: car.color select...

css - My image keeps getting zoomed in using parallax scrolling. -

any gladly appreciated, trying parallax scrolling, image keeps getting zoomed in. parallax : parallax http://www.shck.mx/tests/parallax.png no-parallax : no-parallax http://www.shck.mx/tests/noparallax.png i using css code: #about { background: url(../images/nevsky.jpg) 50% 0 no-repeat fixed; height: 400px; margin: 0px auto; margin-left: -80px; margin-top: 0px; width: 120%; max-width: 1320px; position: relative; box-shadow: 0 0 50px rgba(0,0,0,0.8); box-sizing: border-box; }

Symbols in header files C/C++ -

how find symbols being referenced in header-file source files? want find out programmatically. the brute force method: in source file, comment out inclusion of header file. recompile source file. the compiler should emit list of undefined symbols. you may need apply recursively if header file includes other files. edit 1: map files compiler may able generate cross reference listing of symbols , used. specific each compiler. consult compiler's documentation. also check linker's documentation well. the compiler can generate map file shows symbols, values , locations. may show symobls used, not in header files.

java - Selenium 2 + phantom js: unable to perform actions on a mouseover -

i'm trying perform action on button it's never done. final actions action = new actions(mdriver); final webelement mycart = mdriver.findelement(by.cssselector("path span"]")); final webelement mybutton = mdriver.findelement(by.cssselector("path button")); action.movetoelement(mycart).build().perform(); action.movetoelement(mybutton).click().build().perform(); this code works firefox not phantom js i found issue here how handle mouseover in selenium 2 api or how perform mouseover function in selenium webdriver using java? nothing work phantom. is there known workaround ? thanks! i had similar issues when used ghostdriver , phantomjs around year ago ( fyi article ). had problems ie_driver , chrome_driver too, related visibility of elements outside screen_frame (page must scrolled down). one of serious issues upload_window , handle through already-mentioned. wasn't able achieve doh. workaround switch/cast driv...

indexing - INDEX AND MATCH FUNCTION -DATES INVOLVED -

i need please index , match involving dates. table 1 empl. code name bonus date 1000 smith 1/10/2014 1000 smith 1/6/2014 1000 smith 1/1/2014 2000 aero 1/16/2014 2000 aero 1/11/2014 5000 jethro 1/23/2014 8000 tull 1/18/2014 table 2 empl code name absent date 2000 aero 1/20/2014 1000 smith 1/10/2014 1000 smith 1/6/2014 8000 tull 1/18/2014 table 1 has names , date employee received bonus. table 2 has names of employees absent on given dates objective: create column in table 1 showing if there match between 2 dates, (table 1, bonus date) , table 2 (absent date) particular employee, place date ( formula result) beside employee name . tell enmployee, being absent on date, doesnt deserve bonus. if absent date doesnt apply teh bonus date employee, #na value in appropriate cell beside emp...

python - Ensuring minimum distance between choices -

#!/usr/bin/env python # -*- coding: utf-8 -*- import random, collections, time, os # pseudo-randomly select element table # ensuring minimum distance before same # element selected again def choice_gen(choices, min_dist): last_choices = collections.deque() while 1: choices = set(choices) c = random.choice(list(choices - set(last_choices))) new_min = int(len(choices)*6/10) if min_dist == new_min: last_choices.pop() min_dist=new_min last_choices.append(c) choices = yield c i've kind of edited generator, minimum distance follows proportion: len(choices):min_dist = 10:6 when value given result of proportion new_min int(len(choices)*6/10) changes, deque goes increase in size of 1 element not popping. then, until new_min changes again, keeps popping, ensuring constant size of deque. @ least, that's should do. implementation right? #!/usr/bin/env python # -*- coding: utf-8 -*- import ...

Asp.net MVC preview page before save and highlight the modified model properties -

i need redirect preview page edit page , highlight modified text when preview button clicked in "edit" page. in preview page have save button save in database. how implement feature. try this: @{ string _style = string.empty; for(int i=0;i<model.count;i++){ _style = "none" ; var listedited = ((list<castyourtypeobject>)viewbag.objectedited); if(model[i] == listedited[i]){ _style = "highlight"; } <tr> <td class="@_style">@html.display(objattribute)</td> </tr> } }

Edit Sql Database Using Gridview Asp.net c# -

i'm trying edit information of student table using gridview in c# code updates gridview without changing table in sql database don't know problem here gridview : <asp:gridview id="gridview1" runat="server" autogeneratecolumns="false" datakeynames="s_id" onrowcancelingedit="gridview1_rowcancelingedit" onrowediting="gridview1_rowediting" onrowupdating="gridview1_rowupdating" allowpaging="true" > <columns> <asp:templatefield headertext="id"> <edititemtemplate> <asp:textbox id="s_id" runat="server" text='<%# eval("s_id") %>'></asp:textbox> </edititemtemplate> <itemtemplate> <asp:label id="label1" runat="server"...

combinations - Finding (2n C n) mod (1000000006) -

i trying solve problem on spoj - http://www.spoj.com/problems/powpow/ have reduced stage have find (a ^ (exp % (m-1))) % m,(m = 1000000007) using fermat's little theorem. face big problem find exp % m. can not use inverse modulo here find 1/(n!) mod (m-1) since gcd(n!, m-1) != 1. have researched lot on google , programming websites this. thing have found use chinese remainder theorem solve these equations: n = 1 mod 2 n = exp mod 500000003 , n exp % (m-1) not able understand how can reach these equations? there other way solve this?

objective c - sorting NSMutableArray twice -

i have sorted nsmutablearray , has dictionaries many fields . 2 fields interested me , date , count integer number . i have sorted array date : nssortdescriptor *descriptor = [[nssortdescriptor alloc] initwithkey:@"datecreated" ascending:yes]; sortedwithdates=[sortedwithdates sortedarrayusingdescriptors:[nsarray arraywithobjects:descriptor,nil]]; now, want take objects in array -for today, , sort them again according count integer(highest first) . is there simple way same nssortdescriptor class ? thank . is there simple way same nssortdescriptor class ? yes, there's very simple way. can pass more 1 sort descriptor -sortedarrayusingdescriptors: . items equal according first descriptor sorted according second (or third, etc.). from docs: the first descriptor specifies primary key path used in sorting receiving array’s contents. subsequent descriptors used further refine sorting of objects duplicate values. so code this: n...

django - Creating a custom method using @link() wihout having to pass in look up field -

i'm trying create api end point returns current screener. screener one-to-one model user. hit end point , have necessary info returned, however, return out passing params. right when using @link() decorator url becomes screener/{look-up-field}/current. not have field in url. viewset: class screenerviewset(viewsets.modelviewset): model = screener serializer_class = screenerserializer permission_classes = (objectpermissions,) queryset = screener.objects.all() @link() def current(self, request, *args, **kwargs): screener = get_object_or_404(screener, user__id=request.user.id) data = self.serializer_class(screener) return response(data=data.data, status=status.http_200_ok) my routes: router = defaultrouter() router.register(r'api/screener', screenerviewset) urlpatterns += router.urls the default drf @link decorator works on detail-level. for collection-level @link , @action decorators can use drf-extensio...

python - If your source is ASCII, should you specify coding? -

we have large project entirely coded in ascii. worth putting coding statements @ beginning of each source file (e.g. #coding=utf-8) reason if source doesn't have unicode in it? thanks, --peter ascii default in python 2 . utf-8 default in python 3 . if files ascii-only; don't need declare source code encoding in both version (ascii subset of utf-8). non-ascii character leads syntaxerror in python 2 therefore accidental non-ascii character won't go unnoticed , won't corrupt data. there no reason declare source code encoding ascii-only files.

How to add an SSL certificate to an azure website using powershell? -

i working on automatic deployment + azure. i'm @ point i'm adding ssl cert website. know how use powershell upload ssl certificate website using powershell command (add - - set based commands)? i'm able add certificate cloud service using ... new-azureservice $program -location 'east us' add-azurecertificate -password cert123! -servicename $program -certtodeploy $certlocation but have no idea how add azure website. thanks edit: i've found way using following command, i'm not wanting install additional libraries on production deployment machine. azure site cert add -k cert123! $certlocation $program as far know azure powershell cmdlets not offer capability @ moment find. point out cross platform command line tool does. since don't want add xplat-cli tool deployment machines can use xplat-cli tool under hood: direct call against rest api web site management. note you'll need figure out webspace site resides in, etc. can us...

string - Executing a process in Java with a password -

i have process needs run through java and, unfortunately password needs given process in plain-text. since event transient , working behind massive firewalls, not worried password being transmitted subprocess this. little worried process , processbuilder classes take commands string objects, not char[] arrays. so, have rely on garbage collector destroy string objects @ discretion, allowing possibly take heap dump of program later , password. its remote possibility, looking for: a better way start sub process not use string objects, char[] a way ensure string object destroyed after used. (just note, due how process takes in commands, submitting password inital command way interact sub-process -- see this: java seems sending carriage returns sub-process? comments section in original post) note- password not going main() function via commandline. password collected using swing jpasswordfield, being written processbuilder command array. idea-- wonder if there way throug...