Posts

Showing posts from July, 2015

jQuery check if two passwords match -

so i'm busy on system, includes registration users. need jquery check if password , password confirmation matching. i've come with: $("#pass2").keypress(function() { if ($("#pass1").val() != $("#pass2").val()) { $(".nosamepass").fadein('slow'); $("#choosepass > input").css("border", "5px solid #ff0033"); } else { $(".nosamepass").fadeout('slow'); $("#choosepass > input").css("border", "5px solid #232323"); } }); .nosamepass { display: none; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="choosepass"> <h1>{{goodgoing}}<span id="name2"></span></h1> <h2>{{choosepassword}}</h2> <h3>{{almostthere}}</h3> <input name="pass1" id=...

How to fix an error in parsing paths using scala parser? -

i writing scala parser parse following input(x number): /hdfs://xxx.xx.xx.x:xxxx/path1/file1.jpg+1 trait pathidentifier extends regexparsers{ def pathident: parser[string] ="""^/hdfs://([\d\.]+):(\d+)/([\w/]+/(\w+\.\w+)$)""".r } class parseexp extends javatokenparsers pathidentifier { def expr: parser[any] = term~rep("+"~term | "-"~term) def term: parser[any] = factor~rep("*"~factor | "/"~factor) def factor: parser[any] = pathident | floatingpointnumber | "("~expr~")" } i getting following error: [1.1] failure: `(' expected `/' found can't figure out problem! there 2 problems here. first trying match string starts /hfds input starts /hdfs . secondly regular expression have try match input anchors put ( ^ , $ ). means when parser pathident used, try match input until reader has no more values return. in input there +1 after .jpg , \w not match...

vb.net - Crystal Reports only shows the last column -

since new crystal report have search 3 hours still couldn't find right answer problem. please check code. dim rptsumrep crystaldecisions.crystalreports.engine.reportdocument dim sda new mysqldataadapter dim bsource new bindingsource dim dtincom new datatable dtincom.clear() conn.open() dim queryincom string = "select *from tblbilling date_conduct between '" & dtfrom.value.date.tostring("yyyy-mm-dd") & "' , '" & dtto.value.date.tostring("yyyy-mm-dd") & "'" sda = new mysqldataadapter(queryincom, conn) sda.fill(dtincom) bsource.datasource = dtincom sda.update(dtincom) grid.datasource = bsource rptsumrep = new crystalreport1 rptsumrep.setdatasource(dtincom) frmcrystalreport.crystalreportviewer1.reportsource = rptsumrep frmcrystalreport.crystalreportviewer1.refresh() frmcry...

MySQL Booking system: Getting available rooms -

i have problem query locating available rooms in simple hotel booking system. my table structure looks following: hotels hotelroomtypes (intersects hotel, room , roomtype) bookings orders there more it, use of other tables sums in query, looks following: select distinct hotels.hotelname ,hotels.hotelid ,hotels.address ,hotels.description ,images.url ,roomtypes.price ,roomtypes.roomtypename ,roomtypes.roomtypeid ,count(distinct hotelroomtypes.hrid) availablerooms hotelroomtypes inner join hotels on ( hotelroomtypes.hotelid = hotels.hotelid , hotels.countryid = 1 // e.g. united states ) inner join roomtypes on ( hotelroomtypes.roomtypeid = roomtypes.roomtypeid , roomtypes.roomtypeid = 1 // e.g. suite ) right outer join bookings on ( hotelroomtypes.hrid not in ( select hrid bookings bookings.fr...

sql - DLookup on a report in Access 2013 -

i have attendance log keeps track of patient attendance in office. have many therapists see patients. therapists listed on "employees" table id called "id". on table "cancellog table", have field stores name of therapist patient supposed see called "therapist". lookup field "employees" table. our staff can select name , can add options add , remove therapists. have report pulls directly table, showing relevant fields can @ number of cancelations had. showing therapist, shows id, not name. in "employees" table have field stores "first name" , "last name". i have report show name , not number in text box. have tried using dlookup , ended following: = dlookup([employees]![first name], [cancellog table], "[therapist]="'& [employees]![id] &"'") but not working. assistance helpful. thank you.

ajax - cURL + PHP + File Upload issues -

hello fellow programmers. i beginner programmer , have failed attempt creating script uploading image on 1 specific site. my boss needs upload images specific site. speed things need create script that. i use multi-part form data curl, site different. here headers post /upload-new.php?banner_url=http%3a%2f%2ftest.com&ad_type=1&banner_size= http/1.1 host: admin.domain.com user-agent: mozilla/5.0 (windows nt 6.1; wow64; rv:38.0) gecko/20100101 firefox/38.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: lv,en-us;q=0.7,en;q=0.3 accept-encoding: gzip, deflate content-type: application/octet-stream x-file-name: indonesia.gif x-file-size: 15450 x-file-type: image/gif x-file-date: fri, 29 may 2015 09:48:22 gmt x-requested-with: filedrop-xhr-fileapi referer: https://admin.domain.com/campaigns-edit.php content-length: 15450 cookie: goals= connection: keep-alive pragma: no-cache cache-control: no-cache gif89a,ú http/1.1 200 ok server...

Android - Overflow Menu and Back Button not showing in Collapsing Toolbar -

i'm trying implement features new design support library create parallax scrolling toolbar looks similar new material design whatsapp profile pages. however, can't overflow menu , button show in top corners. i have tried using following methods display button, none of them works. getsupportactionbar().setdisplayhomeasupenabled(true); getsupportactionbar().sethomebuttonenabled(true); getsupportactionbar().setdisplayshowhomeenabled(true); and overwriting oncreateoptionsmenu method overflow menu didn't work. does know how add these toolbar icons collapsingtoolbar design support library? below layout xml activity. thanks! <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemw...

python - Splitting columns of a numpy array easily -

how can split array's columns 3 arrays x, y, z without manually writing each of [:,0],[:,1],[:,2] separately? import numpy np data = np.array([[1,2,3],[4,5,6],[7,8,9]]) print data [[1 2 3] [4 5 6] [7 8 9]] x, y, z = data[:,0], data[:,1], data[:,2] ## me here! print x array([1, 4, 7]) transpose, unpack: >>> x, y, z = data.t >>> x array([1, 4, 7])

PHP XAMPP Restart Apache Through Browser -

i'm trying create whm / plesk type control panel clients use. running xampp on vps , want users able to, example, ban ip's change take effect apache needs restarted. is there way using php user can click button , apache service restart? i have tried using following php code stop apache server, doesn't bring up? <?php shell_exec("apache_stop.bat"); ?> <?php shell_exec("apache_start.bat"); ?> both bat files in same directory php file , have amended them files relative them adding ..\..\ file paths. is there 1 file can run both tasks automatically or there better way this? after stop apache, exit , not start second job. may use script 2 jobs

composer php - symfony upgrade from 2.3 to 2.7 -

i'm trying upgrade symfony 2.3 2.7 using recomendations in knp blog composer gave me this: loading composer repositories package information updating dependencies (including require-dev) requirements not resolved installable set of packages. problem 1 - conclusion: don't install symfony/symfony v2.7.1 - don't install symfony/symfony v2.7.0|remove symfony/var-dumper v2.6.7 - don't install symfony/var-dumper v2.6.7|don't install symfony/symfony v2.7.0 - don't install symfony/symfony v2.7.0|don't install symfony/var-dumper v2.6.7 - installation request symfony/symfony 2.7.* -> satisfiable symfony/symfony[v2.7.0, v2.7.1]. - installation request symfony/var-dumper == 2.6.7.0 -> satisfiable symfony/var-dumper[v2.6.7]. i try change composer.json to: { "name": "symfony/framework-standard-edition", "license": "mit", "type": "project", "autoload": ...

Copying array by value in JavaScript -

when copying array in javascript array: var arr1 = ['a','b','c']; var arr2 = arr1; arr2.push('d'); //now, arr1 = ['a','b','c','d'] i realized arr2 refers same array arr1 , rather new, independent array. how can copy array 2 independent arrays? use this: var newarray = oldarray.slice(); basically, slice() operation clones array , returns reference new array. note that: for references, strings , numbers (and not actual object), slice copies object references new array. both original , new array refer same object. if referenced object changes, changes visible both new , original arrays. primitives such strings , numbers immutable changes string or number impossible.

ios - UIView transform inside a UITableViewCell does not work -

i have arrow button inside uitableviewcell should rotate 180 degrees when clicked or when method gets called somewhere else. works when click button , update sender.transform. @ibaction func rotate(sender: uibutton) { if (top) { uiview.animatewithduration(0.5, animations: { sender.transform = cgaffinetransformmakerotation((360.0 * cgfloat(m_pi)) / 180.0) }) } else { uiview.animatewithduration(0.5, animations: { sender.transform = cgaffinetransformmakerotation((180.0 * cgfloat(m_pi)) / 180.0) }) } } if change code reference button instead uitableviewcell this, not work. button not rotate. ibaction func rotate(sender: uibutton) { let detailcell = tableview.cellforrowatindexpath(nsindexpath(forrow: 0, insection: 0)) as! detailcell if (top) { uiview.animatewithduration(0.5, animations: { detailcell.arrowbutton.transform = cgaffinetransformmakerotation((360.0 * cgfloat(m_pi)) / 180.0) }) } else { uiview.animatewithduratio...

java - What is faster: equal check or sign check -

i wonder operation works faster: int c = version1.compareto(version2); this one if (c == 1) or this if (c > 0) does sign comparasion use 1 bit check , equality comparasion use substraction, or not true? certainty, let's work on x86. p.s. not optimization issue, wondering how works. assuming operations jitted x86 opcodes without optimization, there no difference. possible x86 pseudo-assembly snippet 2 cases be: cmp i, 1 je destination and: cmp i, 0 jg destination the cmp operation performs subtraction between 2 operands (register i , immediate 0 ), discards result , sets flags: positive, negative, overflow etc. these flags used trigger conditional jump (i.e. jump if condition), in 1 case if 2 operands e qual, in second case if first g reater second. again, without considering software (jvm-wise) and/or hardware optimization. in fact, x86_64 architectures have complex pipeline advanced branch-prediction , out-of-order execution, these micro...

jquery - Responsive jqGrid with bootstrap classes to the column headers -

i have below simple jqgrid. need responsive table columns hidden in mobile view using bootstrap helper classes such hidden-xs var gridinfojson = json.parse($('#hdn-categorysummary').val()); var catgrid= jquery("#categorysummary").jqgrid({ url: '/category/getcategories/', datatype: 'json', mtype: 'post', colnames: ["id", "active", "name", "duration"], colmodel: [ { name: 'id', index: 'id', hidden: true }, { name: 'isactive', index: 'isactive', align: 'center', formatter: activecheckboxformatter, sortable: false,classes:'col-sm-1' }, { name: 'categoryname', index: 'categoryname', formatter: generatecategorynamelink, sortable: false }, { name: 'comboduration', index: 'comboduration', classes:'hidden-xs' , align: 'center', sortable...

grid - wxpython wxgrid attributes -

i'm having trouble highlighting alternative rows in grid. having created grid , filled data, highlighting alternative rows works expected. when new data loaded, delete rows, add new rows required, , time grid highlighting raises exception unhandled typeerror. has me stumped- suggestions? code below produces same error (click button twice):- import wx import wx.grid gridlib app = wx.app() def highlightrows(event): row in range(0, mygrid.getnumberrows(), 2): if row < mygrid.getnumberrows(): mygrid.setrowattr(row, attr) mygrid.forcerefresh() mygrid.refresh() frame = wx.frame(none, title="highlight woes") panel = wx.panel(frame) mygrid = gridlib.grid(panel) mygrid.creategrid(12, 8) sizer = wx.boxsizer(wx.vertical) sizer.add(mygrid, 1, wx.expand) panel.setsizer(sizer) btn = wx.button(panel, -1, 'highlight rows') sizer.add(btn) btn.bind(wx.evt_button, highlightrows) attr = wx.grid.gridcellattr() attr.setbackgroundcolour('#eeeeee...

scala - Zeppelin SqlContext registerTempTable issue -

i trying access json data using sqlcontext.jsonfile in zeppelin... following code execute without error: import sys.process._ val sqlcon = new org.apache.spark.sql.sqlcontext(sc) val jfile = sqlcon.jsonfile(s"file:///usr/local/src/knoldus/projects/scaladay_data/scaladays2015amsterdam_tweets.json") import sqlcontext.implicits._ jfile.registertemptable("jtable01") output : import sys.process._ sqlcon: org.apache.spark.sql.sqlcontext = org.apache.spark.sql.sqlcontext@7034473 jfile: org.apache.spark.sql.dataframe = [ id: struct, content: string, hashtags: array, score: struct, session: string, timestamp: bigint, tweetid: bigint, username: string] import sqlcontext.implicits. next verify table name registered sqlcon.tablenames().foreach(println) output : jtable01 but when try run following error: %sql select * jtable01 output : no such table jtable01; line 1 pos 14 at same time when run tutorial example ...

Combine 4 bytes into one in Java -

here code: import java.io.fileoutputstream; import java.io.ioexception; import java.util.map; public class shiftcodes { private map<byte[], byte> shiftmap; public byte genobyte(byte b1, byte b2, byte b3, byte b4) { return (byte) ( (b1 << 6) | (b2 << 4) | (b3 << 2) | b4); } public static void main(string[] args) throws ioexception { shiftcodes shiftcodes = new shiftcodes(); byte b = shiftcodes.genobyte((byte) 0x01, (byte) 0x11, (byte) 0x00, (byte) 0x10); fileoutputstream fileoutputstream = new fileoutputstream("/tmp/x.bin"); fileoutputstream.write(new byte[] {b}); } } it's assumed bits of each byte zero, except rightmost 2 bits, can 0 or 1. changed code little: public class shiftcodes { private map<byte[], byte> shiftmap; public byte genobyte(byte b1, byte b2, byte b3, byte b4) { return (by...

python - Getting cookies with requests -

when try access tor sites .cab web proxy using browser, first disclaimer .cab proxy, , after clicking button through actual .onion site. think site uses cookies determine if disclaimer has been clicked, when delete cookies browser, disclaimer again when try access sites. however, when try access sites requests, don't cookies: >>> r = requests.get(address) >>> r.cookies <requestscookiejar[]> i've tried using sessions, same thing happens. how can cookies using python requests? the url i'm trying " https://qzbkwswfv5k2oj5d.onion.cab/ ". i've tried both no headers, , headers chrome sends: host: qzbkwswfv5k2oj5d.onion.cab connection: keep-alive cache-control: max-age=0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 user-agent: mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/43.0.2357.124 safari/537.36 accept-encoding: gzip, deflate, sdch accept-language: en-gb,en-...

magento - Mail not sent automatically with cron -

i facing problem custom email. email not sent automatically according schedule. cron working fine. have debug code using mage::log() . getting each log before sendtransactional function after log not working. however working fine aoe_schedule when execute cron forcefully. but not working automatically.. so code correct. problem automatic cron execution. you can create crontab file in server cmd crontab -e in open window shell=/bin/bash path=/sbin:/bin:/usr/sbin:/usr/bin mailto=your email error message */5 * * * * full path site cron.sh file(example: /home/username/www/public_html/cron.sh ) this execute cron.sh every 5 minutes , aoe_sheduler dosen't write warning heartbeat

javascript - Rotation does not change after setting transformation matrix for camera -

any idea how apply transformation matrix perspectivecamera? have transformation matrix , setting perspective camera using camera.applymatrix(transformationmatrix); it correctly sets camera.position camera.quaternion remains unchanged. rotation works when set camera.matrixautoupdate = false breaks trackballcontrols. have tried adding camera.updatematrix trackballcontrols again, resets rotation. have tried setting position, quaternion , scale of camera manually as: camera.matrixautoupdate = false; camera.usequaternion = true; var position = new three.vector3(); var quaternion = new three.quaternion(); var scale = new three.vector3(1, 1, 1); transformationmatrix.decompose(position, quaternion, scale); camera.position.copy(position); camera.quaternion.coy(quaternion); camera.scale.copy(scale); camera.updatematrix(); it yields same result, set correctly trackballcontrols not work. edit: want set matrix once, not @ every frame. inside animate loop try call cam...

c# - Error while trying populate DropDownListFor from Database -

i trying populate dropdownlistfor items database, when tried run program, gives me error object reference not set instance . method (get data database , put selectlist ) did not called @ all, though have called , set controller . could please tell me going wrong? here code using: get data database: (inventory class) (row id table below there default when created database) private string connectionstring = @"data source=(localdb)\v11.0;attachdbfilename=|datadirectory|\db1.mdf;integrated security=true"; [display(name = "moduledata:")] public string moduledata { get; set; } public string id { get; set; } public string name { get; set; } public ienumerable<selectlistitem> listdata { get; set; } public selectlist getdata() { list<selectlistitem> lists = new list<selectlistitem>(); using (sqlconnection conn =...

mysql - inserting and deleting rows in the most optimal way -

i have existing table id, name, user 15, bob, 1 25, alice, 2 30, ann, 1 55, bob, 2 66, candy, 1 we want name records user 1 set values in string: "ann, candy, dave" if easy way delete table user = 1 insert table (name,user) values (ann,1), (candy,1), (dave,1)` then table looks this id, name, user 25, alice, 2 55, bob, 2 67, ann, 1 68, candy, 1 69, dave, 1 i.e. new rows created. don't want new identities, , on time in huge tables, causes fragmentation , identity holes , on. efficient way in sql reduce actual 2 required operations: delete table user = 1 , name not in string "ann, candy, dave", table then: 25, alice, 2 30, ann, 1 55, bob, 2 66, candy, 1 ` insert table user = 1, name = value "ann, candy, dave" not match name/user=1 , table then: 25, alice, 2 30, ann, 1 55, bob, 2 66, candy, 1 67, dave, 1 it sounds have list , want process twice, once deletes , once inserts. store list in temporary table , use processi...

.htaccess - Mod_pagespeed do not work for make_google_analytics_async -

this code in .htaccess file ... , sure mode_pagespeed works. <ifmodule pagespeed_module> modpagespeed on modpagespeedenablefilters make_google_analytics_async . . . </ifmodule> and in html add java script code (i got here ) <html> <head> <script type='text/javascript'> var gajshost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); glue_script var ga = document.createelement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getelementsbytagname('script')[0]; s.parentnode.insertbefore(ga, s); </script> <script type="text/javascript"> try { var pagetracker = _modpagespeed_getrewritetracker("ua-63697801-1"); pagetracker._track...

c++ - why hough transform detects two lines while there is only one line -

Image
i detect line , extract 2 ended points. common approach using hough transform. luckily there sample in opencv regarding matter, therefore i've drawn line 2 ended points p1(100,200), p2(400,200) . thought aforementioned method provid me these points. sample image the hough transform provides me 2 images for canny filter, in code, seems there 2 lines detected. explains why red line thicker indicates fact there 2 lines rather one. when print out number of lines, shows me 2 follows lines.size(): 2 p1:<99,201> p2:<401,201> lines.size(): 2 p1:<102,198> p2:<398,198> why i'm getting 2 lines? it might due width of bins in houghspace. choose 1 of default opencv functio, i.e. houghlines(x, x, 1, cv_pi/180, x, x, x ); the arguments not x define width of bins see . there says: rho : resolution of parameter r in pixels. use 1 pixel. for first argument , second: theta: resolution of parameter \theta in radians. use 1 degree (...

when python loads json,how to convert str to unicode ,so I can print Chinese characters? -

i got json file this: { 'errnum': 0, 'retdata': { 'city': "武汉" } } import json content = json.loads(result) # supposing json file named result cityname = content['retdata']['city'] print cityname after that, got output : \u6b66\u6c49 know it's unicode of chinese character of 武汉 ,but type of str isinstance(cityname,str) true. how can convert str unicode , output 武汉 i have tried these solutions: >>> u'\u6b66\u6c49' u'\u6b66\u6c49' >>> print u'\u6b66\u6c49' 武汉 >>> print '\u6b66\u6c49'.decode() \u6b66\u6c49 >>> print '\u6b66\u6c49' \u6b66\u6c49 searched ascii,unicode , utf-8 ,encode , decode ,but cannot understand,it crazy! need ,thanks ! your json contains escaped unicode characters. can decode them actual unicode characters using unicode_escape codec: print cityname.decode('unicode_escape') not...

Getting gulp-sourcemaps to map correctly with a series of plugins -

i have git repo multiple plugins (1 main 1 , several intended work main one). using this approach distribution, since bower doesn't provide way have more 1 plugin per git repo. so, need minify each plugin, create sourcemap each plugin, , drop each 1 individual distribution folder corresponds git submodule, convention naming same plugin make simple. came following gulp script in 1 step, based off of answers found here . return gulp.src(['./jquery.dirtyforms.js', './helpers/*.js', './dialogs/*.js'], { base: './' }) .pipe(jshint()) .pipe(jshint.reporter(stylish)) .pipe(rename(function (path) { var basename = path.basename; var dirname = path.dirname; if (dirname == 'helpers' || dirname == 'dialogs') { path.basename = 'jquery.dirtyforms.' + dirname + '.' + basename; console.log(path.basename); } path.dirname = path.basename; })) .p...

Android switch Fragments in the new design support navigation drawer -

how can switch fragments in new design support navigation drawer? found example codes on cheesesquare github on how switch fragments using tablayout, not navigation drawer. same? not recreate fragments when switching, rather tablayout retains fragments instance , fragment`s content how user left it. write code this: navigationview.setnavigationitemselectedlistener( new navigationview.onnavigationitemselectedlistener() { @override public boolean onnavigationitemselected(menuitem menuitem) { menuitem.setchecked(true); mdrawerlayout.closedrawers(); switch (menuitem.getitemid()) { case r.id.your_menu_id: getsupportfragmentmanager().begintransaction().replace(r.id.fragment, getfragment(), "set_a_tag").addtobackstack("set_a_tag").commit(); break; } return true; } }); private yourfragment getfragment() { yourfragment f = getsupportfragmentmanager().f...

html - curved style for image -

Image
how design curved style image in 3d! the original image has show below image. because in 3d rotation need show in dynamically below image. for editing in photoshop each image has take time need manipulate @ run time. div.img img{ margin: 5px; padding: 5px; height:250px; width: 500px; float: left; text-align: center; } <div class="img"> <img src="http://po-web.com/wp-content/uploads/2013/12/it-solution1.jpg" alt="klematis"> </div> you can efect setting multiple divs same background image, , arranging them in curved path along z axis. as extra, can hover animation .test { width: 800px; height: 600px; position: relative; transform-style: preserve-3d; perspective: 1200px; transition: perspective 2s, transform 2s; margin: 50px; } .test:hover { perspective: 600px; transform: scale(0.85); } .element { background-i...

MYSQL group by month,year and get highest score for month -

please me? i trying last 10 winners photo of month competition recent first excluding current month, here have far:- select *, max(total_score) comp_images date_added between date_sub(curdate(),interval 10 month) , curdate() , concat(month(curdate()),'',year(curdate())) != concat(month(date_added),'',year(date_added)) , url != '' , hide = '0' group month(date_added) order total_score desc limit 10 any appreciated. thanks my guess getting images back, max total score. problem here separately selecting rows (with *) , max(total_score) have not bound them together. what solve using having keyword of mysql. can give criteria select rows statement. example: select * comp_images..... having max(total_score);

javascript - Mock code in another module -

i want mock amazon aws s3 getobject the code want test following one: in helper.js var aws = require('aws-sdk'); var s3 = new aws.s3(); exports.get_data_and_callback = function(callback, extra){ s3.getobject( {bucket: src_bucket, key: src_key}, function (err, data) { if (err != null) { console.log("couldn't retrieve object: " + err); }else{ console.log("loaded " + data.contentlength + " bytes"); callback(data, extra); } }); } in test/helper_test.js i wrote test should mock module aws var assert = require('assert'); var mockery = require('mockery'); describe("helper", function() { it('loads , returns data s3 callback', function(){ mockery.enable(); var fakeaws = { s3: function(){ return { getobject: function(params, callback){ callback(null, "hello") } } } ...

osx - qmake cannot find file -

system: mac osx yosemite. i installed qt 4.8.7 homebrew, , went directory cloned github (magread @ https://github.com/ieatlint/magread.git ). i ran: qmake magread.pro and got error: cannot find file: magread.pro. but file in directory! i googled , found one similar question on here on stack overflow, answers didn't me. i'm noob qt appreciated on how project build. thanks! file names case sensitive. try qmake magread.pro or this, if directory name magread or if there 1 .pro file in current directory: qmake

c# - Linq to Sql escape WHERE clause -

Image
i have linq-to-sql query daynamiccontext.log = new system.io.streamwriter("f:\\linq-to-sql.txt") { autoflush = true }) var tt = daynamiccontext.gettable(tbl); var query = ((from c in tt c.isdeleted != true select c.id).take(1)).tolist(); the result of final query correct got single id. the problem when have big data got out of memory exception. when checked generated query select [t0].[id], [t0].[createdby], [t0].[createddate], [t0].[modifiedby], [t0].[modifieddate], [t0].[isdeleted], [t0].[untiletime], [t0].[desktop], [t0].[laptop], [t0].[title], [t0].[responsive], [t0].[mobile], [t0].[activetime], [t0].[tablet] [countent_freearea] [t0] it seems linq-to-sql getting data database , filtering on memory. public class context { private datacontext daynamiccontext; public datacontext daynamiccontext { { if (daynamiccontext == null) { system.configuration.connectionstringsettingscollect...

c# - Clear list but retain Session -

i have code list shown, var refinedclaimsearchnew = new claimsearch(); (int = 1; < refinedictionary.length; i++) { list<claimsearchdatavalues> claimtable = new list<claimsearchdatavalues>(); int count = i; if (count == 1) { claimtable = refinedclaimsearch.rowvalues; } else { //my problem in else loop claimtable = (list<claimsearchdatavalues>)session["test"];//get list out of session if (refinedclaimsearchnew.rowvalues != null) { refinedclaimsearchnew.rowvalues.clear(); //and clear list retain session value} } var dictionaryitems = refinedictionary[i]; string[] dictionaryitemssplit = dictionaryitems.split(','); (int j = 1; j < dictionaryitemssplit.length; j++) { var nodeelement = dictionaryitemssplit[j]; foreach (var row in claimtable) { var currentrow = row; bool hasrefinevalue = false; foreach (var rowvalues in currentrow...

CSS + JQUERY Slider Errors -

i'm using slider , i'm getting error message in google chrome console. there way fix it? here's demo : slider.js:10 uncaught typeerror: cannot set property 'checked' of null slider.js:10 uncaught typeerror: cannot set property 'checked' of undefinedslider @ slider.js:10 slider.js:10 uncaught typeerror: cannot set property 'checked' of null slider.js:10 uncaught typeerror: cannot set property 'checked' of nullslider @ slider.js:10 slider.js:10 uncaught typeerror: cannot set property 'checked' of undefinedslider @ slider.js:10 slider.js:10 uncaught typeerror: cannot set property 'checked' of nullslider @ slider.js:10 slider.js:10 uncaught typeerror: cannot set property 'checked' of undefined for sure better include code here not link .. anyway the problem here setinterval(function slider(){.....}) just use setinterval(function(){ ...... }); you can take @ http://jsfiddle.net/ul50cqmw/ may need l...

Maven in OSX Keeps Compiling with Java 1.5 -

i have code i'm working on 2 different location, win7 machine , osx. when worked on using win7 machine, don't need bother java version maven compiles, need set path variable. if i'm on java 5, compiles against java 5, if i'm on java 7, compiles against java 7. no problem there. different case osx machine. exact same set of codes. my java version [mac-pro] ~/apache-maven/apache-maven-3.1.1/conf $ p01ntbl4nk> java -version java version "1.7.0_60" java(tm) se runtime environment (build 1.7.0_60-b19) java hotspot(tm) 64-bit server vm (build 24.60-b09, mixed mode) my maven version [mac-pro] ~/apache-maven/apache-maven-3.1.1/conf $ p01ntbl4nk> mvn -version apache maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 23:22:22+0800) maven home: /users/p01ntbl4nk/apache-maven/apache-maven-default java version: 1.7.0_60, vendor: oracle corporation java home: /library/java/javavirtualmachines/jdk1.7.0_60.jdk/contents/home/jre default loc...

php - Dynamic dropdown list -

subjects course chapters i want add 2 dynamic dropdown lists, 1 subjects, , 1 course. when select subject, courses added subject should loaded in course dropdown list, , add chapters courses. how do that? any appreciated. here code: <div class="content-form-inner"> <div id="page-heading">enter details</div> <div class="form_loader" id="thisformloader"></div> <div id="error_message"></div> <form name="thisform" id="thisform" action="editchapters.php?mode=<?php echo $_request['mode']; ?>&id=<?php echo $id; ?>" method="post" enctype="multipart/form-data"> <table border="0" cellpadding="0" cellspacing="0" id="id-form" > <tr> <th valign="top" style="wi...

javascript - Dragstart event breaks the sequence -

below code: <body> <table border="1"> <tbody data-bind="foreach: $root.list1"> <tr data-bind="event:{dragstart: $root.dragstart, dragend: $root.dragend}" draggable="true"> <td data-bind="text: id"> </td> <td data-bind="text: name"> </td> </tr> </tbody> </table> <table border="1" data-bind="event:{drop: $root.dragdrop, dragover: $root.dragover}"> <tbody data-bind="foreach: $root.list2"> <tr> <td data-bind="text: id"> </td> <td data-bind="text: name"> </td> </tr> </tbody> </table> </div> </body> var myviewmodel = function () { var self = this; self.init = function () { // seed data list1 , list2. } self.list1 = ko.observablearray([]); self.list...

java - how to return two lists from controller class in spring mvc -

i have 2 tables call maintab,subtab generate menubar. maintab has maitabid ,main_tab_name subtab has: sub_tb_id ,main_tb_id,subtab_name ,url i want 2 list containig list1=maintabid & maintabname list2=subtabname,maintabid & url i want return 2 list using spring mvc. , retrieve in jsp page populate menu.please give me code of controller class , jsp: use hibernate , tile sample. i tired public string listmaintabandsubtabs(map<string, object> map) { map.put("maintab", new maintab()); map.put("maintablist", contactservice.listmaintab()); return "maintab"; } how return subtabs , main tabs both 1 method.... why want return list, use map instead. in controller can use, map mp = new hashmap(); mp.put("list1", lst1); mp.put("list2", lst2); return mp; in jsp, can iterate map, for (map.entry<> entry : mp.entryset()) { string listkey = entry.getkey(); ...

angularjs - Angular Material - Long Textarea Forces Scroll To Top -

i'm having difficulties text areas , angular material. when there's enough content in text area force bottom "below fold", typing causes page scroll top. continuing type scrolls page down , scrolls up. is bug in ngmaterial, or doing wrong here? (i've checked documentation multiple times trying see if did wrong.) code i'm using, stripped of unnecessary: angular.module('testtextarea', [ 'ngmaterial' ]) .controller('appcontroller', function($scope) { $scope.level = { title: '', content: 'asdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\nasdfasdf\n' }; }); <!doctype html> <html ...