Posts

Showing posts from September, 2014

mysql - How to change the color of a cell of Datagridview by comparing the cell date with today's Date in C#.net? -

i new c#,this first project on c# language , backend mysql, stuck @ particular point ,i having form containing datagridview binded database value,in have column "tns_date" expiration date of product ,i want if tns_date greater current date background colour of particular cell should red in colured ,how ,please me this i using winforms , till had tried foreach (datagridviewrow row in tnsformdgv.rows) { var = datetime.now; var expirationdate = datetime.parse(row.cells[15].value.tostring()); var onemonthbefore = expirationdate.adddays(-30); if (now > onemonthbefore && < expirationdate) { row.defaultcellstyle.backcolor = color.yellow; } else if (now > expirationdate) { row.defaultcellstyle.backcolor = color.red; } } when executing project getting error object reference not set instance of object this whole code particular form please check getting wrong public partial

ruby - SyntaxError: playlist.rb:33: syntax error, unexpected end-of-input, expecting keyword_end -

hate ask this, can't life of me find end error, can help> please, thanks. require_relative 'playlist' describe playlist before @playlist = playlist.new("kermit") end context "being played 1 movie" before @initial_rank= 10 @movie = movie.new("goonies", @initial_rank) @playlist.add_movie(@movie) end "give movie thumbs if high number rolled" @playlist.play(5) @movie.rank.should == @initial_rank + 1 end "skips movie if medium niumber rolled" @playlist.play(3) @movie.rank.should == @initial_rank end end end

mysql - Subtract PHP variable from DB -

i'm using codeigniter , trying subtract 1 of input values database no luck. current model is: $newstock = $this->input->post('f2'); $itemname = $this->input->post('f1'); $this->db->where('itemname', $itemname); $this->db->set('stock', 'stock-'.[$newstock], false); i error: severity: notice message: array string conversion filename: models/inventory.php found solution: $itemname = $this->input->post('f2'); $query = $this->db->select('stock')->from('inventory')->get(); foreach ($query->result() $row) { $row->stock; } $oldstock = $row->stock; $numtosub = $this->input->post('f2'); $numtosub; $newstock = $oldstock - $numtosub; $newstock; $data = array('itemname' => $this->input->post('f1'

mysql - Trying to select all fields in a row with the lowest MIN( ) -

i'm having trouble trying select lowest price , unique url that's in same row, @ moment it's getting unique_url first row. select min( price ), `unique_url` `product_price` `barcode` = '" . $product_barcode . "' , `active` = '1' group `user_id` order `price` asc limit 1 help! try this select min( price ) mprice, `unique_url` `product_price` `barcode` = '" . $product_barcode . "' , `active` = '1' group `user_id` order mprice asc limit 1

Backup and Restore MySQL database in PHP -

i trying use php backup , restore mysql database: backup: $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'dbpass'; $dbname = 'test'; $output = "d:/backup/test.sql"; exec("d:/xampp/mysql/bin/mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname > $output"); echo "backup complete!"; restore: $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'dbpass'; $dbname = 'test'; $output = "d:/restore/test.sql"; exec("d:/xampp/mysql/bin/mysql --opt -h $dbhost -u $dbuser -p $dbpass $dbname < $output"); echo "restore complete!"; but both not working. when backup complete check test.sql file blank. when restore complete, database still blank. how can fix this? script backup using php <?php define("backup_path", "/home/abdul/"); $server_name = "localhost"; $username = "root"; $password

html5 - Responsive Navigation menu not working -

i trying design responsive nav bar. dont know css3. except tablet, nav bar works fine. please me missing tablet size. need add media query tablet size? or changes needs done in nav tags <nav class="clearfix"> <ul class="clearfix"> <li><a href="#">home</a></li> <li><a href="#">menu1</a></li> <li><a href="#">menu1</a></li> <li><a href="#">menu1</a></li> <li><a href="#">menu1</a></li> <li><a href="#">menu1</a></li> <li><a href="#">menu1</a></li> <li><a href="#">menu1</a></li> </ul> <a href="#" id="pull">menu</a> </nav> here css nav nav { height: 40

How do I apply an AngularJS directive based on a class set by ng-class? -

i'm trying conditionally apply directive element based on class. here's simple case of issue, see results in fiddle . example, i'm using map of class names booleans form of ng-class true ; in actual case i'd use boolean result of function. markup: <div ng-app="example"> <div class="testcase"> have directive applied expect </div> <div ng-class="{'testcase':true}"> not have directive applied expect </div> </div> js: angular.module('example', []) .directive('testcase', function() { return { restrict: 'c', link: function(scope, element, attrs) { element.css('color', 'red'); } } } ); why isn't directive being applied div that's getting class through ng-class ? misunderstanding order in angularjs processing directives? how should conditionally applying direc

javascript - How to click an input field many times? -

sorry question,but not familiar javascript need help.i programming in python , c & c++ . need javascript geniuses. what's script click on input field once every time page refreshes? there input field on live web page(testing) , want script generate 1000 clicks, each click after page refreshes. how can that? if you're curious why, it's because i'm testing mini-web browser programmed. please before down-vote tell me what's wrong question. <input type="text" id="target"> $(document).ready(function() { var = 1; if(window.location.hash) { var hash = parseint(window.location.hash.replace("#", ""), 10); = hash + 1; } if(!window.location.hash || hash < 1000) { $('#target').trigger('click'); window.location.hash = i; window.location.reload; } }); but why want this?

autohotkey - Send, SendInput, SendEvent functions entering single key multiple times -

i have created script in autohotkey.i have enter entire file path opened in file browser.i have used send function passes same keys multiple times. tried using function setkeydelay still enters keys multiple times. tried other alternatives sendinput , sendevent still didnt work. if terminate script in between , if control switches input box or editor, starts entering values area. send function keeps on entering keys after script execution terminated. script: ;open adobe acrobat 8. run acrobat.exe sleep, 1000 winwait, adobe acrobat professional, sleep, 1000 ;open compare documents window send, {alt}a sleep, 1000 send, u winwait, compare documents, ;enter file path ifwinnotactive, compare documents, winactivate, compare documents, winwaitactive, compare documents, sleep, 1000 send, !h winwaitactive, open,,1000 sleep, 1000 sendevent, "d:\sample\a.pdf" it enters text this cccc:::::\\ddddiiiiii things try: update autohotkey latest

python - How to load mapinfo file into geopandas -

i suspect trivial question answer how load mapinfo mid/mif files geopandas? while it's trivial load , manipulate .shp files, can't work out code use: here's few examples of data i'm trying play with: http://www.stoke.gov.uk/ccm/content/business/general/open-geospatial-consortium-data-catalogue.en cylpaths = geopandas.geodataframe.from_file(path) i tried test geometry, shows: cylpaths.crs out[15]: {u'ellps': u'airy', u'k': 0.9996012717, u'lat_0': 49, u'lon_0': -2, u'no_defs': true, u'proj': u'tmerc', u'towgs84': u'375,-111,431,-0,-0,-0,0', u'units': u'm', u'x_0': 400000, u'y_0': -100000} but when try preview data, empty dataframe: cylpaths out[16]: int64index([], dtype='int64') empty geodataframe i'm bit lost in working out need next.

android - GridView not fit properly under Gallary -

in main screen, have gallery , textview , 3 x 3 gridview , gridview under gallery , textview , gridview suppose fit on screen sizes, using s grand duos , s3 test. renders on s3, on grand duos not, on grand duos vertical spacing joined , have scroll gallery view last row of gridview . <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/bg" android:orientation="vertical" android:weightsum="100" > <gallery android:id="@+id/gallery" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="40" android:adjustviewbounds="true" android:background="#000000" android:scaletype="fitxy" /> <textv

python - Some issue with Unicode encoding -

Image
i trying open , parse json file using python script , write content json file after formatting want. source json file has character /" want replace blank . don't have issue in parsing or creating news file issue character not getting replaced blank. how do it. earlier have achieved same task there no such character in document time. here code doublequote = "\"" try: destination = open("todayshtscrapeditemsoutput.json","w") # open json file output except ioerror: pass open('todayshtscrapeditems.json') f: #load json file data = json.load(f) print "file loaded" dataobj in data: news in data[cnt]["body"]: news = news.encode("utf-8") if(news.find(doublequote) != -1): # if doublequotes found in first body tag # print "found double quote" news.replace(doublequote,"") if(news !=""): my_news = my

Red circle before Contact FullName in Advanced Find (Dynamics CRM 2011) -

Image
the client asked me question - red circle before full_name in advanced find results window (see screenshot below)? does know or @ least how reproduce it? ok know is. if have contact email address crm show status of contact online/offline add email address contact , see icon. save , find contact see red circle. mouseover circle , show details presence unkown/available. ok if want reproduce it... in administration click system settings set im presence option yes re-apppear

c++ - Creating a substreambuf to read from an existing istream -

i'm attempting create custom std::streambuf acts sub-stream parent stream. adaptation of implementation outlined in this thread answer . in example below attempting read first 5 characters "hello," of stream. however, when call ifstream.read() buffer , buffer filled "ello, " , though off one. #include <iostream> #include <sstream> using namespace std; int main() { stringstream ss; ss << "hello, world!"; substreambuf asd(ss.rdbuf(), 0, 5); istream istream(&asd); char buffer[6] = { '\0' }; istream.read(buffer, sizeof(buffer)); cout << buffer << endl; //prints "ello, " } i new streambuf s , feel i'm missing obvious here. appreciated. here definition substreambuf : #include <iostream> #include <sstream> namespace std { struct substreambuf : public streambuf { explicit substreambuf(streambuf* sbuf, streampos pos, stream

javascript - ProcessingJS code permission -

Image
since java updated security settings in jan. , can't afford trusted certificate sign in jar file online, 200 usd year, converted processing2 jar file processing1.5 javascript file. , problem is, let visitors see js output, have let them @ least 'read' pde file, while don't want make source code public. so how can present work without releasing source code? lot! my processing folder under /var/www/html/visual: -rw-r--r--. 1 root root 2709 sep 10 21:03 main.pde -rw-r--r--. 1 root root 238 mar 6 15:12 proj01.html -rw-r--r--. 1 root root 231867 mar 4 23:55 processing-1.4.1.min.js the html file looks (so visitors know pde file name): <!doctype html> <html> <head> <script src="processing-1.4.1.min.js"></script> </head> <body> <canvas data-processing-sources="main.pde"></canvas> </body> </html> and self-signed jar file blocked java update51 u

Go: efficiently handling fragmented data received via TCP -

i writing small tcp-server suppose read data, parse receiving data (dynamic length frames) , handling these frames. consider following code: func clienthandler(conn net.conn) { buf := make([]byte, 4096) n, err := conn.read(buf) if err != nil { fmt.println("error reading:", err.error()) return } fmt.println("received ", n, " bytes of data =", string(buf)) handledata(buf) this pretty essence of code is. read x bytes empty buffer , handle data. the problem occurs when: a frame of data bigger buffer trying read tcp connection. in case cannot handle data until receive rest (but receving buffer occupied previous data). when buffer contains 1 , half frame of data , need handle first frame, while keeping incomplete frame later... in case need remove handled part buffer, , move incomplete part there room remainder of frame. both scenarios require reallocation , copying of data, may perhaps costly operation? f

android - my activity not being called with action_view -

i have create activity in application com.example.one calls activity in application com.example.two. in activity 2 manifest have declared following intent-filter <intent-filter> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <data android:scheme="http" /> </intent-filter> however on calling activity action - intent.action_view or android.intent.action.view directly invokes browser rather intent chooser have put. intent ii=new intent(intent.action_view); ii.setdata(uri.parse("http://www.google.com")); startactivity(intent.createchooser(ii,"done")); kindly update why not getting intent chooser browser , activity. thanks clear browser defaults settings, try invoke method, should ask action choose available apps, time , always, here go it. to clear go se

drupal 7 - Different Cluster to Different Layers in the same Map -

i have map showing 2 different kind of projects, national projects , regional projects. each type of project in different layer, made views, shown in same map. apply different cluster each layer, e.g. national projects cluster in green , distance of 5px, regional projects cluster in blue , distance of 20px. i 2 layers not mix between them, meaning regional layers should not cluster national one. i using drupal 7, openlayers 2.0beta-7 is possible? thank you!! solution: finally decided go easy way , added custom behavior called custom_cluster can apply different 1 each layer. if have understood question, think can this: http://openlayers.org/dev/examples/strategy-cluster-extended.html generally, cluster strategies defined @ level of vector layer, having 2 separate ones within 1 map view achieved adding 2 different vector layers, each own markup , clustering strategy.

What is the use of the following statement in python regular expression? -

i new python , need work on existing python script. can explain me meaning of following statement pgre = re.compile("([^t]+)t([^\.]+)\.[^\s]+\s(\d+\.\d+):\s\[.+\]\s+(\d+)k->(\d+)k\((\d+)k\),\s(\d+\.\d+)\ssecs\]") you need consult references exact meanings of each part of regular expression, basic purpose of parse gc logging. each parenthesized part of expression () group matches useful part of gc line. for example, start of regex ([^t]+)t matches first "t", , grouped part returns text before "t", i.e. date "2013-08-28" the content of group, [^t]+ means "at least 1 character not t" patterns in square brackets [] character classes - consult references in comments above details. note input text contains literal square brackets, pattern handles \[ escape sequence - see below. i think can simplify ([^t]+)t (.+)t , incidentally. other useful sub-patterns: \s matches whitespace \d matches numeric digits

c# - How to save snapshot without showing SaveFileDialog? -

i want take snapshot webcam , save in given path.the webcam should start after given time period.this code have tried works don't need popup savefiledialog when file saving.how save snapshot without showing savefiledialog? please help..... private void btnstartpic_click(object sender, eventargs e) { int delay = convert.toint32(numericupdown1.value); int miliseconds = delay * 1000; thread.sleep(miliseconds); this.refresh(); cm = new videocapturedevice(wcam[cmbdevice.selectedindex].monikerstring); cm.newframe += new newframeeventhandler(cam_newframe); cm.start(); string path = txtbrowse.text; string currentdatetime = string.format("text-{0:yyyy-mm-dd_hh-mm-ss-tt}.bin", datetime.now); savefiledialog s = new savefiledialog(); s.filename = currentdatetime + ".jpg"; s.defaultext = ".jpg"; s.filter = currentdatetime + "(.jpg)|*.jpg";

position - On Android, how to draw a Rect like pygame Rect? (x, y, w, h) -

is there way of drawing rect in android in following pattern, instead of "left, top, right, bottom"? problem i'm using random coordinates: rect e = new rect(random.nextint(300)+20,20,random.nextint(300)+45,70); and it's hard keep track of first left random position include in right 1 width. in "x, y, w, h", it's easy apply collision test: if ((((p.left+p.width())>e.left)&&(p.left<(e.left+e.width())))&& (((p.top+p.height())>e.top)&&(p.top<(e.top+e.height())))) { gamescreen = 2; } just move random numbers outside of constructor rect. int left = random.nextint(300)+20; int right = left + 20; int top = random.nextint(300)+45; int bottom = top + 70; rect e = new rect(left, top, right, bottom);

arrays - Element wise multiplication of every row/column of a matrix with a vector -

i have matrix, named p_c_w having dimensions 6x7599 , other matrix named p_w having dimensions 1x7599. wish have element-wise multiplication unable that. size of rows of p_c_w , columns of p_w same, have taken transpose of p_c_w , stored in anss. error receving is: subscripted assignment dimension mismatch. code below. can please help? thanks lot in advance anss=p_c_w' i=1:size(anss,1) j=1:size(p_w,2) temp(j,i)=anss(i,j).*p_w(j); end end use bsxfun : a = [ 1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5 ]; b = [ 1 10 100 1000 10000]; c = bsxfun(@times,a,b) returns: c = 1 20 300 4000 50000 1 20 300 4000 50000 1 20 300 4000 50000 works same a' b' so case: temp = bsxfun(@times,p_c_w,p_w)

windows - Environment variables in cygwin ssh session -

i installed cygwin , sshd on winxp box. sshd runs service. (i used 'ssh-host-config' configure , 'cygrunsrv -s sshd' start it) now login , execute command linux box using usual ssh client in 2 different ways: using users password authentication: ssh jenkins@192.168.xxx.xxx "cmd /c echo %userdomain%, %username%" using public key authentication: ssh -i /path/to/private_key/id_rsa jenkins@192.168.xxx.xxx "cmd /c echo %userdomain%, %username%" the output is: 1.) winxp_hostname, jenkins 2.) nt authority, system could explain how happens: why user belongs different domains. ... , can tune/influence ?

PHP regex to extract controller and action from string -

so developing symfony2 application. if know talking know how routes structured there need extract routes , controllers , actions. i found how extract route object can't extract controller , action, have string has them. so have string: acme\somebundle\controller\defaultcontroller::indexaction all string have similar structure. strings end controllername::actionname. controller name ends "controller" , action name end "action". couldnt figure how extract theese values string. new regex read don't have clue how this. please me, apreciated :) example string: `emca\anotherbundle\controller\securitycontroller::loginaction` example output: securitycontroller loginaction i think can't 1 regex 2 may enough. thank you! an example can found in symfony's controllernameparser class: $controller = 'acme\yourbundle\controller\securitycontroller::loginaction'; if (0 === preg_match('#^(.*?\\\\controller\\\\(.+)controller)

osx - Embossing effect in the menubar for NSStatusItem -

Image
i'm developing application icon in mac os status bar. i add icon with: self.statusitem = [[nsstatusbar systemstatusbar] statusitemwithlength:nsvariablestatusitemlength]; nsbundle *bundle = [nsbundle mainbundle]; nsimage *connectedimage = [[nsimage alloc] initwithcontentsoffile: [bundle pathforresource: @"drawing" oftype: @"pdf"]]; [self.statusitem setimage:disconnectedimage]; it shows fine without traditional embossing (or shadow) effect apple system status items have: you can see on left icon, , on right apple icon effect. i have tried different image formats without luck. effect present if use internal icon, that: [self.statusitem setimage:[nsimage imagenamed:nsimagenamelocklockedtemplate]]; should add effect myself image or there obvious i'm missing? thank you! you need do [myimage settemplate:yes]; then system indent you.

javascript - Return individual days opening hours from foursquare venue endpoint -

the foursquare api returns following, located @ data.response.venue.hours, venue opening hours at: hours: { status: "closed until noon", isopen: false timeframes: [ { days: "mon–wed", open: [ { renderedtime: "noon–11:00 pm" } ], segments: [ ] }, { days: "thu", includestoday: true, open: [ { renderedtime: "noon–midnight" } ] segments: [ ] }, { days: "fri–sat", open: [ { renderedtime: "11:00 am–1:00 am" } ] segments: [ ] }, { days: "sun", open: [ { renderedtim

python - Destroy everything inside a window outside of function Tkinter -

in code below destroy inside window root when gamebutton button pressed, other things happen way button run function. when perform self.destroy outside of main class, nothing deleted, there way around this? from pil import image, imagetk tkinter import tk, label, both,w, n, e, s, entry, text, insert, toplevel ttk import frame, style, button, label import tkinter import callingwordlist difficulty = "" class mainmenuui(frame): def __init__(self, parent): frame.__init__(self, parent) self.parent = parent self.initui() def initui(self): self.parent.title("type!") self.pack(fill=both, expand=1) style = style() style.configure("tframe", background="black") logo = image.open("type!.png") typelogo = imagetk.photoimage(logo) label1 = label(self, image=typelogo) label1.image = typelogo label1.place(x=342,y=80) l

how to pop a dialog in mobile using mobile jquery with out click event -

i have tried of snippets how not work me may approach not correct. it displays dialog wihout poping here completed code. body please me out. i tried code in jsbin.com editer. <!doctype html> <html> <head> <link href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" charset="utf-8" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script> </head> <body> <div id="divid" data-rel="dialog" > dialog </div> </div> <script> (function(){ $.mobile.changepage( $('#divid'), { role: 'dialog', transition: 'pop'} ); })(); </script> </body> </html>

mongodb - how to display uploaded pdf/text_files/videos using mongoid-paperclip -

i using mongoid-paperclip gem upload files. able display images have uploaded. how display pdfs/videos. please me solution. this image model. class image has_mongoid_attached_file :logo validates_attachment :logo, :content_type => [ "application/pdf"] validates_attachment_content_type :logo, :content_type => ["image/jpg", "image/jpeg", "image/png"] field :logo end view file: <% @images.each |image| %> <%= image_tag(image.logo.url(:original)) %> <% end %> thanks in advance. replace validates_attachment :logo, :content_type => [ "application/pdf"] validates_attachment_content_type :logo, :content_type => ["image/jpg", "image/jpeg", "image/png"] with validates_attachment_content_type :logo, :content_type => ["image/jpg", "image/jpeg", "image/png", "application/pdf"] no need validate separa

android - How to avoid ontouchlistner to stop working when clicked on imageview -

in application, have set ontouchlistener , onclicklistener imageview . problem when click imageview both ontouchlistener , onclicklistener working. want avoid ontouchlistener when clicked on image, , when dragging imageview ontouchlistener should work , onclicklistener should avoided. suggestions... below code: imageview.setonclicklistener(m_onclicklistner); imageview.setontouchlistener(this); @override public boolean ontouch(view v, motionevent event) { if (event.getaction() == motionevent.action_down) { }else if (event.getaction() == motionevent.action_move) { } if (event.getaction() == motionevent.action_up) { } return true; } onclicklistener m_onclicklistner = new view.onclicklistener() { @override public void onclick(view v) { } }; i case should use setonlongclicklistener dragging. imageview.setonlongclicklistener(new onlongclicklistener() { @override public boolean onlongclick(view v)

javascript - Promises in Series are not getting executed in sequence -

i have written code based on parse example provided in parse.com execute promises in series. but, seems sequential processing not working fine. the below code calls cloud function namely 'samplecloudfuction' multiple times in sequential order through series of promises. after executing loop, app make call js function load remaining items (excluding processed items). this loop make multiple calls cloud function: var seriespromise = new parse.promise.as(); $.each(items, function (i) { .. .. count++; if (count >= 25 || (i + 1) >= selecteditemslength) { .. .. //series promise: code executed in sequence being placed within //then() existing promise seriespromise = seriespromise.then(function () { parse.cloud.run('samplecloudfuction', itemsarray, function () { console.log("success callback i

html - Can't highlight text -

check http://discoveryobstacleruns.nl/ . can't highlight text on site, doesn't seem z-index issue , doesn't have other means block text highlighting. idea what's causing it? edit: disabling js seems trick, leads believe it's google maps causing it. however, elements above map clickable, content on top of map why wouldn't able highlight text? so, apparently document.getelementbyid('map').bind('click', function(e) { if(e.stoppropagation) { e.stoppropagation(); } }); fixes gives error message in console. makes sense because should be: document.getelementbyid('map').addeventlistener('click', function(e) { if(e.stoppropagation) { e.stoppropagation(); } }); but doesn't work @ (doesn't give error though). gives??

javascript - Backbone.sync scope issues -

i'm using backbone.sync send collection php function, stores information in database , returns data based on his. everything works until success function of .sync() , lose scope of model , collection can't update them, there way around this? i've tried using 2 methods , neither seem return anything, , can't find more information on subject on here or google. it's in preferences avoid using model.save() , it's many calls backend. method 1 ; var that=this; // logic done here backbone.sync("update",this.collection,{ success:function(data){ // attempt update this.collection here, `that` out of scope // , scope of `this` different } }); method 2 : var that=this; var ondatahandler=function(data){ // attempt update this.collection here, `that` out of scope // , scope of `this` different }; // logic done here backbone.sync("update",this.collection,{ success:ondatahandler }); does know way aroun

What is the difference between a user app with root access and a system app in Android -

the answer looking in aspect of permissions. can system app ? can user app root access (ie on rooted device) everything? if so, same? theoretically, user app root access have same priority system apps (because can modify system files), guess user app root access can "everything".

java - Issue when using ORDER BY clause in criteria builder -

we add order clause in criteria builder bellow. criteriaquery.orderby(criteriabuilder.asc(request.get("name")), criteriabuilder.asc(type.get("val"))); when see query looks like order p.named.val but expect order p.name,d.val in actual result comma(,) missing in between p.name , d.val. please suggest me whey comma not there? we use javax criteriabuilder.

wpf - Does caliburn micro support IsEnabledChanged? -

i want have method fire when button's enabled state changes, not work. method void enablestartscan(bool isenabled) in view model never gets called. <telerik:radribbongroup header="{x:static res:stringtable.machinectrl}"> <telerik:radribbonbutton x:name="btnstart" text="{x:static res:stringtable.start}" size="large" largeimage="/mcsp;component/resources/images/button-start.png"> <i:interaction.triggers> <i:eventtrigger eventname="isenabledchanged"> <cal:actionmessage methodname="enablestartscan"> <cal:parameter value="{binding elementname=btnstart, path=isenabled}"/> </cal:actionmessage> </i:eventtrigger> </i:interaction.triggers> </telerik:radribbonbutto

html - What versions of IE supported by bootstrap? -

Image
from bootstrap : specifically, support latest versions of following browsers , platforms. on windows, support internet explorer 8-11. more specific support information provided below. but tested site in latest browsers displaying fine. when tested on internet explorer it's display showing if mobile view(as use col-xs-*:: contents displayed view). in ie11 -- it's fine. in ie10 -- it's fine. in ie9 -- it's displaying if mobile view in ie8 -- it's displaying redundantly so, said bootstrap supports ie8 , , ie9? i'm using bootstrap 3.1.1 , testing site on windows. ie versions 8 , newer supported. following meta tag required prevent ie entering 'compatibility mode', emulates ie7. (this why site has issues ie9.) <meta http-equiv="x-ua-compatible" content="ie=edge"> documentation: http://getbootstrap.com/getting-started/#support-ie8-ie9 ie8 fails support following: border-radius , box-shadow , tra

.net - How to make a textbox that runs the vb.net line in it? -

i'm new here , searched answers possible, if typ in textbox1 "application.exitthread" runs or if "checkbox1.checked = true" too?? possible? thanks! you're looking vbcodeprovider. can execute code @ runtime http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.vbcodeprovider(v=vs.110).aspx

emacs - Elisp: make symbol-function return the source? -

here's setup: (defun square (x) (* x x)) ;; square (symbol-function 'square) ;; (lambda (x) (* x x)) (byte-compile 'square) ;; #[(x) "\211_\207" [x] 2] (symbol-function 'square) ;; #[(x) "\211_\207" [x] 2] is there way source (lambda (x) (* x x)) after square has been byte-compiled? the 2 uses can think of inlining current function call , doing debug-step-in. i've tried messing find-definition-noselect source, wonder if there's better way, because raises (error "don't know ... defined") emacs keeps track of function name defined in file (this info kept in load-history ). find definition, emacs looks in load-history , if function listed there, looks corresponding source file , in file looks looks definition of function (using regexps). that's find-definition-noselect does. as source code, no in general emacs not keep source definition. if define function cl-defsubst , source kept around, o

Installing OpenCV on Raspbian for Java, "Could not FindJNI" -

i'm trying install opencv on raspbian can deploy java code onto rpi. however, having cmake find jni proving irksome task. 1 question answered here noted administrator needed have java_home set well, not user. set in /etc/environment prior setting in .bashrc. how resolve "could not find jni", building opencv on raspberry pi? however, cmake still cannot find jni, after updated find include directories noted in following; cmake find_package(jni) not work in ubuntu 12.04 amd64 i've tried many different combinations, including java installation , environment setting at, though unzips java in /opt/java , recommends setting java_home there; http://elinux.org/rpi_java_jdk_installation pertinent findjni.cmake lines include; set(java_awt_include_directories "[hkey_local_machine\\software\\javasoft\\java development kit\\1.4;javahome]/include" "[hkey_local_machine\\software\\javasoft\\java development kit\\1.3;javahome]/include" "

eclipse - View Custom perspective when breakpoint is triggered -

i have created custom debug perspective , want open automatically when breakpoint triggered. @ moment, default debug perspective opens , have keep switching preferred one. how can achieve this? in eclipse, go window > preferences > run/debug > perspectives . in application types/launchers box, expand java application item , select eclipse jdt launcher . in debug dropdown right, select custom debug perspective. click ok .

java - App is shutting down when Maps isn't installed -

when click on link maps, app closing because no maps application installed. how can give alert @ start of app, can't use maps no maps application installed. thanks, you need create 1 method this public boolean ispackageexisted(string targetpackage) { packagemanager pm = getpackagemanager(); try { packageinfo info = pm.getpackageinfo(targetpackage, packagemanager.get_meta_data); } catch (namenotfoundexception e) { return false; } return true; } then check if (ispackageexisted("com.google.android.maps")) { // map application available } else { // map application not available }

php - echo class "active" - if class="" is already exists or not. -

the following php function add class="active" current page open. <?php #add class .active current page $directoryurl = $_server['request_uri']; $path = parse_url($directoryurl, php_url_path); $components = explode('/', $path); $currentpage = preg_replace("/\\.[^.\\s]{3,4}$/", "", end($components)); if ($currentpage == "") { $currentpage = "index"; } function href($url) { global $currentpage; $path = explode('/', $url); $page = preg_replace("/\\.[^.\\s]{3,4}$/", "", end($path)); echo 'href="' . $url . '"'; if ($page == $currentpage) { echo 'active'; } } ?> here menu items: <li><a class="icon-glass"<?php href('index.php');?>>home</a></li> <li><a <?php href('about.php');?>>about</a></li&g

sql - SELECT INTO with HSQLDB -

i trying create new table result of select. works fine sql server: select * newtable (select col1, col2, col3 oldtable) x; now, want achieve exact same thing hsqldb (version 2.2). have tried several forms like select * newtable (select col1, col2, col3 oldtable); select newtable select col1, col2, col3 oldtable; create table newtable select col1, col2, col3 oldtable; all these variants result in form of syntax error. how can create table select hsqldb? the manual has example this: create table t (a, b, c) (select * atable) data hsqldb requires parentheses around select (unlike other dbms) , requires with data clause

tig - Find previous chunk to stage -

how navigate previous chunk stage when viewing single file in tig status mode? what i'm looking opposite stage-next (mapped @ default), there no stage-previous can find. a previous question here @ stackoverflow regarding non-existing feature functioned feature request, later filled , referenced in answer, i'd love see again if applicable. as point out there no stage-previous . preferred way add keybindings prompt commands. example: bind stage 2 :?^@@ bind stage d :/^diff note using new feature part of upcoming release of version 2.0.

nginx - When i use http verify is ok, but https not allowed -

when use rack-oauth2 authorisation, http allowed, https token.to_mac_token.verify!(request) getting "signature invalid" does have idea how fix issue? when make signature server , client different port, worry server config...

perl - How to modify a single separator in between the text -

hello: looking modify 1 separator in between following text either awk, perl or sed a,b,c,d,e,f,g,,,,k,l,m to output a,b,c,d,e-f,g,,,,k,l,m how modify nth separator ? in advance you can use sed , sed 's/,/-/5' yourfile

android - Activity done(in application MyapplicationName)Not Responding? -

i have thread wating ontouchevent() private runnable disconnectcallback = new runnable() { @override public void run() { // perform required operation on disconnect try { wait(); } catch (interruptedexception e) { e.printstacktrace(); } final logout l=new logout(); l.setcontext(ac2.this);// passing context of ac3.java logout.java l.execute(sessid,uname); } }; when user touches screen oneventtouch() called public boolean oneventtouch(motionevent event) { disconnectcallback.notify(); return true; }; and application stops , give following error on emulator activity done(in application myapplicationname)not responding(wait or forceclose)

asp.net mvc - jquery validate unobtrusive custom fields -

i have validation metadatas in asp mvc project. i want validate metadatas in client side jquery.validate , jquery.validate.unobtrusive. the problem metadatas [email], [phone] or [url] it's not validated in client side, it's validated in server side. is there form of validating metadatas in jquery.validate? is there somo form of adding custom validations in jquery.validate? thanks. if using jquey.validate below link has demo of , http://jquery.bassistance.de/validate/demo/ below example that $().ready(function() { // validate comment form when submitted $("#yourform").validate(); // validate signup form on keyup , submit $("#yourform").validate({ rules: { firstname: "required", lastname: "required", username: { required: true, minlength: 2 }, password: { required: true, minlength: 5 }, confirm_password

Dynamic column name using cursor in Oracle PLSQL -

i need generate column name dynamically in loop , access column in oracle table using plsql. how do that? declare varvalue varchar(20); cursor c select * test1; begin in c loop j in 1..5 loop execute immediate 'select ''name1'||to_char(j)||''' dual' varvalue; dbms_output.put_line(j); dbms_output.put_line(i.varvalue); end loop; end loop; end; actual issue is, need acccess cell values of each row (i) given cursor (c) i.name11, i.name12....i.name1100. logic deployed in each cell same. need column name used here i.e. name11 generated dynamically. alread done , stored variable varvalue. how can access cells i.varvalue such var value generated in loop. the error follows: ora-06550: line 14, column 34: pls-00302: component 'varvalue' must declared ora-06550: line 14, column 11: pl/sql: statement ignored declare varvalue varchar(20); cursor c select * test1; begin

java - How can we enhance performance using hooking? -

the java docs says java docs public class bufferedreader extends reader reads text character-input stream, buffering characters provide >efficient reading of characters, arrays, , lines. the buffer size may specified, or default size may used. default large >enough purposes. in general, each read request made of reader causes corresponding read request >made of underlying character or byte stream. therefore advisable wrap >bufferedreader around reader read() operations may costly, such >filereaders , inputstreamreaders. example, bufferedreader in = new bufferedreader(new filereader("foo.in")); will buffer input specified file. without buffering, each invocation of >read() or readline() cause bytes read file, converted >characters, , returned, can inefficient. but hooking filereader using filereader's read method read file reads 1 character @ time,so if file contains 2000 characters filereader firstly read

ios - for-loop problems changing property of all objects in array -

my first time , hope is/was not problem me. upfront, create , stuff without .nib, .xib or storyboard , quite new xcode. problem description: i create series of labels, go array programmatically. int below or equal 4 else not fire anyway. int = (int)[players count]; if (i<=4) { namelabel = [[uilabel alloc]initwithframe:cgrectmake(self.view.bounds.size.width-(self.view.bounds.size.width/3)-20*widthmultiplayer, self.view.bounds.size.height-((50*heightmultibplyer)*i)-50*heightmultibplyer, (self.view.bounds.size.width/3), 50*heightmultibplyer)]; namelabel.text = entername.text; [namelabel setfont:[uifont fontwithname:@"arial-boldmt" size:fontsize]]; [namelabel settextalignment:nstextalignmentright]; [self.view addsubview:namelabel]; players[i] = namelabel; nslog(@"index: %i , name:%@", i, namelabel.text); entername.text = @""; } then hide labels programmatically following code for (uilabel *label in playe

c# - Framework or tools to analyze .NET code -

i'm looking software can: - analyze .net source code (c# or vb.net) - build repository can queried (ndepend , resharper similar) - allow query repository looking classes, methods, calling methods, , on (like resharper or ndpend) - accessing method's name, local variables name, type, static value , method text i use creating documentation stored procedure called software. ndepend wonderful tool analyzes il / source code , allows write queries following one, but doesn't provide access constant value of string (i need them identify stored procedure name / parameters). from m in types.withfullnamenotin( "core.dbobject").childmethods() let depth0 = m.depthofisusing("core.dbobject") depth0 >= 0 && !m.name.contains(".ctor") orderby depth0 select new { m, depth0 } what final purpose? i've got big source code in vb.net. track every call stored procedure saving: the call stored procedure behave follows: runprocedure(

odata - Search by keyword in Saferproducts.gov API? -

i trying search report on basis of keyword safeproducts api ( http://www.saferproducts.gov/webapi/cpsc.cpsrms.web.api.svc ) provide search functionality on site @ http://www.saferproducts.gov/search/default.aspx but not find way search it. api in odata format have never used before guessing may lack of knowledge of how query odata based service or don't provide search method in web service. can 1 plz confirm understanding correct ? thanks, khan yes, can use $filter have search. if service based on odata v3, uri should be: http://services.odata.org/northwind/northwind.svc/customers?$filter=substringof('alfreds', companyname) you can reference odata v3 url conventions if service based on odata v4, uri should be: http://host/service/customers?$filter=contains(companyname,'alfreds') you can reference odata v4 url conventions by way, can access http://www.saferproducts.gov/webapi/cpsc.cpsrms.web.api.svc/$metadata identify service versi

android - Cordova/PhoneGap 9-patch splash screen -

i have 9-patch image ( splash.9.png ) i'd use cordova (3.4.0) app splash screen. if run (cordova) android project eclipse, it's supposed be, i.e. splash screen appears , stretchable areas stretched. however, if run app using command line interface, entire splash screen stretched/deformed, if cordova doesn't see 9-patch image, regular .png. have following specified in config.xml: <preference name="splashscreen" value="splash" /> <preference name="splashscreendelay" value="5000" /> is there else needs set? other clues? in advance! ok, answer has stretchy areas of 9patch image. found answer pinging github question. user sent me discussion had cracked it. the main issue 9patch tutorials explain how stretch buttons, none detail how center image. look green/blue/red image little more half way through discussion. http://community.phonegap.com/nitobi/topics/stretched_9_patch_splash_screens_android wayback

sql server - Error in Dynamic PIVOT Table in SQL -

i getting error in dynamic pivot table. i have tables tt_child ttchild_id tt_id roll_no std_reg_id attendance 1 3 1 22 1 2 3 2 23 0 and table tt_master tt_id attend_date time_from time_to course_id faculty_id acad_year subject_id 1 2014-03-01 10:00 11:00 1 16 2013-2014 34 2 2014-03-02 10:00 11:00 1 16 2013-2014 34 3 2014-03-03 10:00 11:00 1 16 2013-2014 34 student_registration_master std_reg_id stud_fname stud_mname stud_mname --i using pivot query getting error. have use attend_date , time column name. create procedure [dbo].[attendance_test] @courseid int=null, @acadyear nvarchar(15)=null declare @collist varchar(max) declare @qry varchar(max) set @collist = stuff((select distinct ',' + quotename(convert(varchar(19)