Posts

Showing posts from May, 2013

oracle - TNS:could not resolve the connect identifier specified -

This summary is not available. Please click here to view the post.

Prolog finding variables -

% check if 2 squares colide sides col( x, y, s, x2, y2, s2):- endx x + s, endy y + s, endx2 x2 + s2, endy2 y2 + s2, ( ( endx =:= x2, ( (y >= y2, y =< endy2);(endy >= y2, endy =< endy2))); % left-l side ( x =:= x2, ( (y >= y2, y =< endy2);(endy >= y2, endy =< endy2))); % left-r side ( endx =:= endx2, ( (y >= y2, y =< endy2);(endy >= y2, endy =< endy2))); % right-l side ( x =:= endx2, ( (y >= y2, y =< endy2);(endy >= y2, endy =< endy2))); % right-r side ( endy =:= y2, ( (x >= x2, x =< endx2);(endx >= x2, endx =< endx2))); % top-t side ( y =:= y2, ( (x >= x2, x =< endx2);(endx >= x2, endx =< endx2))); % top-b side ( endy =:= endy2, ( (x >= x2, x =< endx2);(endx >= x2, endx =< endx2))); % bottom-t side ( y =:= endy2, ( (x >= x2, x =< endx2);(endx >= x2, endx =< endx2))) % bottom-b side ). it's working when set variables, wanted ask ho

JQUERY address.value remove # -

can tell me how can remove # value in adres bar in case of jquery.addres.value this code in existing wordpress theme. have setted seo urls # still in url after click on menu item. var path = (base + "/" != jquery(this).attr('href')) ?jquery(this).attr('href').replace(base, "") : "/"; jquery.address.value(path); regards try this, var url=jquery(this).attr('href'); var temp=url.split('#'); url=temp[0]; jquery.address.value(url);

Regex to certain special characters -

currently have following regex use validate name of company/industry , working fine /(?=[a-za-z0-9-]{5,25}$)^[a-za-z0-9]+(-[a-za-z0-9]+)*$/ the above regex doesnt supports special characters & - . _ valid in case i came wasnt working expected. /(?=[a-za-z0-9-\&\_\.]{5,25}$)^[a-za-z0-9\&\_\.]+(-[a-za-z0-9\&\_\.]+)*$/ can point out above regex goes wrong. short explaination of above regex wud appreciated thanks i don't think have escape & \& , same way _ also /(?=[a-za-z0-9-&_\.]{5,25}$)^[a-za-z0-9&_\.]+(-[a-za-z0-9&_\.]+)*$/

php - to retrive data from database to bind with combobox -

script contains function increment row element defined in html <script language="javascript"> function addrow(tableid) { var rownumber = document.getelementbyid('rownumber'); rownumber.value = parseint( rownumber.value ) + 1; } </script> table consist of row generated automatically clicking add button . i want use value of p_name[] , make[] retrive data database bind combobox model[] error obtained :- notice: undefined variable: make in c:\xampp\htdocs\phpproject1\transaction1.php on line 117 notice: undefined variable: p_name in c:\xampp\htdocs\phpproject1\transaction1.php on line 117 <table id="datatable" border="1" cellspacing="10"> <input id="rownumber" type="hidden" name="row" value="1"/> <tr> <td> 1 </td> <td><select name="p_name[]

Django South - Create Not Null ForeignKey -

i have model class mystery(models.model): first = models.charfield(max_length=256) second = models.charfield(max_length=256) third = models.charfield(max_length=256) player = models.foreignkey(player) i added player foreignkey when try migrate using south seems can't create whith null=false. have message : the field 'mystery.player' not have default specified, yet not null. since adding field, must specify default value use existing rows. to: 1. quit now, , add default field in models.py 2. specify one-off value use existing columns now i use command : manage.py schemamigration myapp --auto thanks lot ! another option create data migration before adding foreignkey, in create new player instance specific id. sure that id not exist in database. 1.create data migration file $ ./manage.py datamigration myapp add_player created 00xx_add_player.py 2.edit forwards , backwards methods of file: def forwards(self

c# - System.InvalidOperationException: Operation is not valid due to the current state of the object.? -

i developing asp.net mvc application sharepoint foundation 2010. asp.net application hosted on 1 machine , sharepoint foundation 2010 hosted on machine. have deployed 1 custom wcf service inside isapi folder of sharepoint environment. custom wcf service creates content databases programatically. asp.net application consumes custom wcf service. using approach because scenario similar link - http://blog.sharedove.com/adisjugo/index.php/2012/07/31/creating-site-collections-in-specific-content-database/ . implemeting above scenario getting error - http://social.technet.microsoft.com/forums/en-us/sharepointdevelopmentprevious/thread/f10d009b-13c4-4942-86b4-2ab8c4f5994d . have solved error http://beyondweblogs.com/sharepoint-2010-sppersistedobject-access-denied/ . getting error - system.invalidoperationexception: operation not valid due current state of object. system.invalidoperationexception: operation not valid due current state of object. @ microsoft.sharepoint.webcontrols.spco

iphone - Is there a trick to transfer metadata to mobile application before it's installed? -

here scenario struggling with: have native application (both android , iphone) being downloaded after qr code scanned sends user app market. i transfer meta data specific qr code scanned prior installation (assume there several types of qr codes leading same application). how go doing that? i understand isn't trivial there's no application installed yet. aiming @ having qr code redirect user mydomain.com keep data user , redirect app market. after application installed, want ask server @ mydomain.com user somehow. can using cookies or similar? process doesn't have reliable. thanks creativity, yuval cohen i don't think possible in ios if manage store cookies in safari, wont able cookies app. have @ this.. https://stackoverflow.com/a/532533/919545 i not sure android though.

javascript - WordPress jQuery Uncaught Reference Error (can't figure it out) -

i have wp site here: http://projects2.yeahcan.com/libdes/ and carousel (elastislide) @ bottom not working. getting error of uncaught reference error , have tried many different things solve it. assumed jquery or js script after altering order of script still can't solve problem. please take , see if figure out?! thanks! you trying use layerslider jquery plugin (on line 102) not included there

php xml dom getElementById and DOMXpath query fails getting element -

i have problems making function replace question , answer elements in xml file. did alot of research learning php dom i'm running stuck @ making function. problem when i'm trying parent element row attribute id returns null or when use xpath returns empty object. don't know if function work correct after the right parent element that's next step think. my xml looks this: <?xml version="1.0" encoding="utf-8"?> <root> <row id="1"> <question>wat doet de vuilnisman?</question> <answer>hij tilt de vuilnisbak in de vuilnisauto.</answer> </row> <row id="2"> <question>wat zegt de tandarts vaak?</question> <answer>u mag nu spoelen.</answer> </row> </root> and php function: //modifies rows function modifyrows($file, $rowids, $rowtext) { $xmldoc = new domdocument(); $xmldoc->preservewhitespace = false;

SharePoint 2013 Standard vs Enterprise Search -

in sharepoint 2013, differences between standard vs enterprise search? and comes different licensing when purchasing sharepoint 2013 enterprise version? check out following comparison chart: sharepoint 2013 feature comparison chart editions official sharepoint 2013 feature comparison chart editions it boils down this: the new content search webpart not available without enterprise the content processing pipeline not extensible standard advanced query rules not available standard the advanced search stuff not many companies use - content search webpart interesting though. licensing done through cals (client access license) per user. means need standard/enterprise license per user uses enterprise features. if you're talking search, might users. there price difference between standard , enterprise cal.

Beginning SQL How do I sum and pick columns in the same line? -

i started learning sql on w3schools.com today, , want make sure i'm on right track. i'm trying solve problem: write sql statement finding combined population of u.s. , mexico (in database). i can't post table here because of lack of reputation, simple. given mexico's country id 2 , u.s. id 5. the table has 4 columns, city_id, name, country_id, , population. not know how many rows there are. need add population columns have corresponding '2' or '5' country id. this have far: //this statement gives result-set cities in mexico , u.s. select * city country_id=’5’ or country_id=’2’ //here, don't know how reference result-set select sum(population) result-set the question says in 1 statement, there simpler way this? thanks. you put sum(population) expression query.. select sum(population) totalpopulation city country_id='5' or country_id='2' note can write x=a or x=b x in (a,b) , i.e. country_id i

windows - Is there a way to stop SQL*Plus exiting on Control-C? -

i'm using sql*plus on windows, , keep accidentally hitting ctrl-c, causes sql*plus exit. there way prevent this? the best workaround i've found far prepend command cmd.exe /k suggested here , @ least keeps prompt open can still see previous commands , results. start /b sqlplus.exe scott/tiger @script.sql

ios - Static Framework Issue: +entityForName: could not locate an entity named 'APIContent' in this model -

can please me understand how fix issue ? attempting add magical record along coredata database inside static framework can use across multiple projects. the exception following: +entityforname: not locate entity named 'apicontent' in model. please code being ran within model below: (void) insertorupdate:(nsdictionary *) objectdictionary { @try { nsmanagedobjectcontext *localcontext = [nsmanagedobjectcontext mr_contextforcurrentthread]; apicontent *product; // check if object exists nspredicate *predicate = [nspredicate predicatewithformat:@"id == %@", [objectdictionary objectforkey:@"id"]]; product = [apicontent mr_findfirstwithpredicate:predicate incontext:localcontext]; bool objectidnotfound = product == nil ? true: false; if (objectidnotfound) { product = [apicontent mr_createincontext:localcontext]; } // import values nsdictionary object [product mr_importvaluesforkeyswithobject:objectdictionary]; [localcontext savetopersistentstor

html - mailto: in android not supporting link in body with blanks -

we need mail links in our html5 (mobile)web page, used mailto: provide links initiating email. mail content has web page links, , contains spaces eg http://maps.google.com/maps?q=chennai tamil nadu hence used url endcoding pass content correctly email client. eg link became http://maps.google.com/maps?q=chennai%20tamil%20nadu but problem gmail app loads content after decoding ie broken links: http://maps.google.com/maps?q=chennai tamil nadu we tried double encoding , still failed. there way prevent issue in android browsers ?? are including correct parameters such ?subject protocol? technically should work without encoding. <a href="mailto:?subject=http://maps.google.com/maps?q=chennai tamil nadu">mail it</a> check out http://msdn.microsoft.com/en-us/library/aa767737(v=vs.85).aspx

java - Packing characters into bits? -

i trying pack characters bits in terms of 0's , 1's. have looked many websites bit-packing did not of them. i want simple idea bit-packing, , how it? thanks a common compression algorithim has been around long time lzw compression. it used gzip, pkzip , jar name few , suitable compressing text. uses combination of huffman encoding , arithmetic coding , few heuristics make more efficient. simple idea bit-packing if find compression , bit packing in general simple, rare breed. ;)

linux - Unix shell finding the max and min values and printing the line from a file -

i have file has numbers @ first column. 100,red 101,blue 102,black i should write shell script print line max , min numbers. max=0 cat file.txt|while read line fir=`echo $line|awk '{print $2}'` sec=`echo $line|awk '{print $3}'` if [ $fir -gt $max ]; max=$fir fi if [ $sec -gt $max ];then max=$sec fi done grep $max file.txt this tried far finding max. for min value: [bash]$ cut -f1 -d"," file_name | sort -n | head -1 for max value: [bash]$ cut -f1 -d"," file_name | sort -n | tail -1

JSP Editor for Eclipse Juno -

i installed eclipse juno , see jsp files not code highlighted. appears if normal text file. the previous versions of eclipse used fine. missing ? try right-click .jsp-file , choose open with > jsp editor . this should trick.

Factorial iteration java -

pocould explain piece of code me?? power function using iteration public static int iterate(int a, int n) { int ; int result = 1 ; for(i = 0 ; < n ; i++){ result = result*a ; } return result ; } it helps know definition of factorial: 0! = 1 1! = 1 2! = 2*1 = 2 3! = 3*2*1 = 6 4! = 4*3*2*1 = 24 n! = n*(n-1)*(n-2)*...*2*1 see pattern? start result = 1 loop , multiply index return result what posted looks more a^n = a*a*a...*a me, not factorial.

objective c - iOS how to copy/reference a C-Array? -

i have 3 arrays ints (enums): static int *openenv[] = {ingmenuitemlogon,ingmenuitemspace,ingmenuitemappointment,ingmenuiteminfo,ingmenuitemsettings}; static int *closedenv[] = {ingmenuitemlogoff,ingmenuitemspace,ingmenuitemoverview,ingmenuitemaccounts,ingmenuitemtransfer,ingmenuitemanalyse,ingmenuitemappointment,ingmenuiteminfo,ingmenuitemsettings}; int *currentenv[]; if user taps on button want currentenv change openenv or closedenv - (void) tap { if( closed ) currentenv = closedenv; else currentenv = openenv; } but gives build errors. openenv , closedenv have 2 different sizes, should copy it? can makes reference or copy static array? you have declared arrays of pointers int . correct be static int openenv[] = {ingmenuitemlogon,ingmenuitemspace,ingmenuitemappointment,ingmenuiteminfo,ingmenuitemsettings}; static int closedenv[] = {ingmenuitemlogoff,ingmenuitemspace,ingmenuitemoverview,ingmenuitemaccounts,ingmenuitemtransfer,ingmenuitemanalyse,ingmenu

Code run but answer not correct ( python) -

player_number=name_to_number(name) player_number=int () # compute random guess comp_number using random.randrange() comp_number=random.randrange (0,4) # compute difference of player_number , comp_number modulo 5 rpsls_match = (player_number-comp_number)%5 # use if/elif/else determine winner if rpsls_match == 1 or 2: rpsls_winner = 'player wins!' elif rpsls_match == 3 or 4: rpsls_winner = 'computer wins!' else: rpsls_winner = 'player , computer tie!' #print "player chooses " + name # convert comp_number name using number_to_name print 'computer chooses ', number_to_name(comp_number),comp_number print 'player chooses ' , name, player_number return rpsls_winner code run correctly did not answer want,, give me answer computer chooses paper 2 player chooses rock 0 player wins! computer chooses lizard 3 player chooses paper 0 player wins! computer chooses spock 1 player chooses scissors 0 player wins!

Django & TastyPie: request.POST is empty -

i'm trying post using curl: curl --dump-header - -h "content-type: application/json" -x post --data '{"item_id": "1"}' http://www.mylocal.com:8000/api/1/bookmarks/ however, request.post empty. below modelresource code: class bookmarkresource(modelresource): class meta: queryset = bookmark.objects.all() resource_name = 'bookmarks' fields = ['id', 'tags'] allowed_methods = ['get', 'post', 'delete', 'put'] always_return_data = true authorization= authorization() include_resource_uri = false def determine_format(self, request): return "application/json" def obj_create(self, bundle, **kwargs): request = bundle.request try: payload = simplejson.loads(request.post.keys()[0]) except: payload = simplejson.loads(request.post.keys()) anybody kno

javascript - how to create an instance of store in controller in extjs -

i want call store of chart init() function in controller. want create instance of store of chart in controller. here code .. ext.define('gamma.controller.controlfile', { extend: 'ext.app.controller', //define stores stores: ['barcolumn', 'radarview', 'voicecallstore', 'smscallstore', 'mmscallstore', 'gprsusagestore'], //define models models: ['barcol', 'radar', 'voicecallmodel', 'smscallmodel', 'mmscallmodel', 'gprsusagemodel'], //define views views: ['barcolumnchart', 'linechart', 'radarchart', 'voicepie', 'smspie', 'mmspie', 'gprspie'], init: function () { this.control({}); } }); please 1 me.. that's easy one: var store = this.getstore('storename'); where this controller. see: ext.app.contro

soap - Exception while Testing SOA Composite Application -

i working on oracle soa suite 11g, beginner , following labs, in developing soa composite applications in jdeveloper 11g ide. while testing composite application using enterprise manager of weblogic server, got following exception: the selected operation execute not invoked. an exception occured while invoking webservice operation. please see logs more details. oracle.sysman.emsdk.webservices.wsdlapi.soaptestexception: javax.xml.soap.soapexception: oracle.j2ee.ws.saaj.contenttypeexception: not valid soap content-type: text/html; charset=utf-8<br> java.lang.exception: oracle.sysman.emsdk.webservices.wsdlapi.soaptestexception: javax.xml.soap.soapexception: oracle.j2ee.ws.saaj.contenttypeexception: not valid soap content-type: text/html; charset=utf-8 @ oracle.sysman.emas.model.wsmgt.wstestmodel.invokeoperation(wstestmodel.java:813) @ oracle.sysman.emas.view.wsmgt.wsview.invokeoperation(wsview.java:385) @ oracle.sysman.emas.view.wsmgt.wsview.invokeoperation(w

angularjs - $rootscope object model from service not (always) available in every controller -

in app definition have: var myvtmodule = angular.module('vtapp', ['myappdev','mongoapi']); myvtmodule.run(function($rootscope, $location, shop){ $rootscope.shopdata = {}; shop.getshop(function(response){ $rootscope.shopdata = response; }); }) shop service retrieving data server, works. problem in controller don't have access shopdata, empty, working normally. function supportctrl($rootscope, $scope) { console.log ($rootscope.shopdata); } why not updating when receives response service? can't put shop.getshop in controller need everywhere... my suggestion use controller inheritance , service child controllers can have access shop. here demo: http://beta.plnkr.co/edit/dtjwlmi3jhcdzthejdnn?p=preview code: angular.module('myapp', ['myapp.services']); function mainctrl($scope, shopservice) { $scope.shop = shopservice.getshop(); } function childctrl($scope) { } angular.module('myapp.se

android - how to diplay geocalisation of an emulator? -

im using html5 technologie,i create small code display langitude , latitude of navigator ( pc navigator). <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> <style type="text/css"> body{ font-family: arial; font-size:0.8em; } div { margin:10px auto 100px; } code{ background-color:#ddd; margin:5px 0; padding:5px; font-size: 1.1em; display:block; width:50%; } h1{ margin:0px; padding:10px; padding-left:40px; font-family: trebuchet ms, arial; font-size:24px; font-style:italic; font-weight: normal; color:#444; } </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"> </script> <script type="text

Casting issue in LINQ (C# .NET 4) -

i have come across confusing problem hope can me with. in application have following data structures: public struct entitydetails { public string entityname { get; set; } public list<attributedetails> attributes { get; set; } public bool entityexists { get; set; } } public struct attributedetails { public string attributename { get; set; } public string displayname { get; set; } public string datatype { get; set; } public string description { get; set; } public bool attributeexists { get; set; } } i instantiate object following: public static list<entitydetails> entitylist { get; set; } so, need able return filtered list of attributes based on entity name , attribute name. wrote following piece of linq: public static list<attributedetails> getfilteredattributelist(string pentityname, string pattributefilter) { return (list<attributedetails>)entitylist.where(e => e.entityname == pentityname)

php - codeigniter add facebook as registration option -

i'm working on online store website own registration procedure. users register on site selecting unique username , password along email address. im looking integrate facebook registration option site well. have questions following: how keep facebook registration process compatible existing one. instance need following registration data in either case. if person clicks facebook login button, how capture additional information? in case user denies me permission, how request again if needed functionality? first , last names registered email address a unique username full date of birth what if user, has native website registration, tries login facebook? should done in case? should new account created , linked native account? should native account converted facebook account? ive tried hunt lot tutorials demos cant find ones. if knows of tutorial / demo, please enlighten me. im looking tutorials / demo that: can deployed locally testing. demonstrates native registrati

jquery - How to use classes of oject in a widget with KendoUI -

i try use custom classes in widget. it's first project kendoui, , wuld create plugin object oriented. var person = kendo.class.extend({ firstname: 'not set', lastname: 'not set', isaprettycoolperson: false, sayhello: function() { alert("hello! i'm " + this.firstname + " " + this.lastname); } }); and widget : (function($, undefined) { var kendo = window.kendo, ui = kendo.ui, widget = ui.widget; var mywidget = widget.extend({ init: function(element, options) { var = this, id; // base call initialize widget widget.fn.init.call(that, element, options); element = that.wrapper = that.element; options = that.options; options.url = window.unescape(options.url); }, options: { name: "mywidget", url: "" }, }); ui.plugin(mywidget);

oracle - PL/SQL trigger for after insert, update, delete that enters Data into Log Table with a Sequence -

This summary is not available. Please click here to view the post.

Populate an array in ruby with 7n +1 -

how make following array programatically in ruby (1.9). it follows pattern 7n + 1 , i'd contain 24 numbers. arr = ["8","15","22","29","36","43","50","57","64","71" ] use collect , apply to_s on result: (1..24).collect{|n| (n*7 + 1).to_s} edit: sorry forgot convert numbers strings. code edited now.

jquery - Equal height on each popups div -

how put equal heigts on each multiple divs? <div class="brands"> <div class="left" style="height:50px;">different height 1 same group</div> <div class="right" style="height:50px;">different height 2 same group</div> </div> <div class="brands"> <div class="left" style="height:150px;">different height 3 same group</div> <div class="right" style="height:150px;">different height 4 same group</div> </div> many thanks. if want them same: $('div.brands').children('div').css('height', '100px'); or, if different ones need different heights: $('div.brands').eq(0).children('div').css('height', '50px'); $('div.brands').eq(1).children('div').css('height', '150px'); to set child divs height of t

Installing phpmyadmin to be able to manage the mysql database the admin created for me -

i dont have access cpanel. can access root of site working on using ftp, domain name, user , password. want install phpmyadmin on root can manage mysql database admin created me. have db name, user , password. need do? need download phpmyadmin, upload install it? please give me details , howto. able use such? also, how migrate contents of mysql databse have access (having its: db name, user , password) one, created site working with. download phpmyadmin following site: http://sourceforge.net/projects/phpmyadmin/files/phpmyadmin/3.5.8.1/phpmyadmin-3.5.8.1-all-languages.zip/download#!md5!a65d444787645735c75bca49cdb558cb upload in seperate folder on webserver via ftp go folder , login database username , password correct warnings , error on bottom of screen (mostly security issues) done :) when have questions errors or warnings please post new question.

view - My picture don't appear on screen on my device -

hello, have problem device. created layout. works fine emulator. when export project gs3 image view disapear. can ? try delete buttons see if picture appear doesn't work. picture in png format. thank you //obtenir les dimensions de l'écran display display = getwindowmanager().getdefaultdisplay(); int largeur = display.getwidth(); int hauteur= display.getheight(); int orientation = display.getorientation(); if (orientation==1 || orientation==3) { linearlayout accueil = new linearlayout(this);// création de la page d'accueil sans passer par les xml accueil.setlayoutparams(new layoutparams(layoutparams.match_parent, layoutparams.match_parent)); accueil.setbackgroundcolor(0xff6e2524); accueil.setorientation(linearlayout.vertical); textview title = new textview(this);//creation du titre layoutparams lparams1 = new layoutparams(layoutparams.match_parent, layoutparams.wrap_content); ti

ios - Add index in plist file programmatically -

i creating plist file programmatically direct documents directory. here code.. nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *path = [documentsdirectory stringbyappendingpathcomponent:@"mylist.plist"]; nsfilemanager *filemanager = [nsfilemanager defaultmanager]; if (![filemanager fileexistsatpath: path]) { path = [documentsdirectory stringbyappendingpathcomponent: [nsstring stringwithformat: @"mylist.plist"] ]; } nsmutablearray *data ; if ([filemanager fileexistsatpath: path]) { data = [[nsmutablearray alloc] initwithcontentsoffile: path]; } else { // if file doesn’t exist, create empty dictionary data = [[nsmutablearray alloc] init]; } data = [[nsmutablearray alloc] initwithcapacity:5]; [data addobject:value1]; [data addobject:value2]; [data addobject:value3]; it creates plist file format.. <array> <str

ios - UITableView Automatically Select Row -

when uitableview loads, want row, in section, selected code in didselectrowatindexpath execute when user loads uitableview . i've tried code below doesn't execute code in didselectrowatindexpath section. thoughts? nsindexpath *indexedpath = [nsindexpath indexpathforrow:0 insection:0]; [tableview selectrowatindexpath:indexedpath animated:yes scrollposition: uitableviewscrollpositionnone]; make use of code.this automatically call didselectrowatindexpath when view loaded. [self tableview:tableview didselectrowatindexpath:[nsindexpath indexpathforitem:0 insection:0]];

php - Can't figure out the usort logic based on 2 variables -

i have array of objects (goals) want sort based on 2 of properties, status , duedate . here rules: statuses: design approved in progress completed archived if goal has status of 4 (completed) or 5 (archived) duedate doesn't matter. if goal neither 4 nor 5 , duedate less "overdue" , should @ top if goal not "overdue" order of statuses determines it's position (lowest highest) if $a , $b both "overdue" 1 earliest duedate more important the order should be: overdue design approved in progress completed archived here last thing tried: function cmp($a, $b) { $now = new datetime("now"); $aduedate = new datetime($a->getduedate()); $bduedate = new datetime($b->getduedate()); if($a->getstatus() != 4 && $a->getstatus() != 5 && $b->getstatus() != 4 && $b->getstatus() != 5){ if($aduedate < $now || $bduedate < $now){ if($aduedate == $b

Lua script - collection data and save into a file -

i working on coding lua script. what coding is..collecting data , save file. situation : there 2 sensors when recognize object in front of it, value of sensor increased. want save data of value of sensor every 100ms time. time format "2013-04-25 10:30:004" what did here. =========================================================== require("timer") require("timestamp") require("analog_in") function onexit() print("exit code...do something") end function main() timer = "timer" analogsensor_1 = "air_1" analogsensor_2 = "air_2" while true valueofsensor_1 = analog_in.readanalogin(analogsensor_1); valueofsensor_2 = analog_in.readanalogin(analogsensor_2); write(colltection_of_data.txt) go(print(valueofsensor_1), 0.1) //print value of sensor every 100ms print(time) go(print(valueofsensor_2), 0.1) print(time) en

xaml - XamDateTimeEditor - user should select the date from the dropdown calender only -- WPF/MVVM -

i have xamdatetimeeditor control in xaml(code given below). user able type in date or select calender dropdown. don't want xamdatetimeeditor allow users type in date through keyboard, should done dropdown using mouse. here code in xaml - <igeditors:xamdatetimeeditor x:name="xamdatetimeeditorentrydate" autofilldate="monthandyear" isalwaysineditmode="true" mask="mm/dd/yyyy" text="{binding entrydate, mode=twoway, updatesourcetrigger=propertychanged, validatesondataerrors=true}" /> you can handle xamdatetimeeditor's previewkeydownevent , set e.handled proprty true in event handler. way user won't able en

sql server - Encryption on the fly -

here interesting have been asked. has encryption of data in non encrypted database. the story has follows. have database, not encrypted , none column encrypted in of tables. now, we'd control trafic of data depending on asking this. let me explain more clear: we have table name: table1 table has 1 column name: sname we'd reach following result. user connected sql server management studio if runs following query: select * table1 to take no result or if he/she takes result, result scrambled. inside application table should exchange data from/to application in normal mode. do know if there setting, or implementation or external tool can provide functionality? i think quite interesting case! thank you. use permissions stop person reading table @ all. or use view hide table , have clause in that applies filter silently: refer table list of approved users. this isn't encryption (well, obfuscation in case) issue.

yii - Updating the existing model with Model Generator -

i generate model model generator , (afterward) add new table , new foreign keys relations. is possible update existing model model generator? or need edit code manually when add new table? have @ gii-template-collection , it's fullmodel template. it generates default 2 classes models, basemodel , model . best-practice me add custom functions, behaviors, scopes, etc... model , leave basemodel untouched. if have changes in database schema, re-generate basemodel class.

https - Iptables DROP SSL traffic (443) -

i'm trying block request ssl resource specific parameters using iptables, i.e.: https://domain.com/hello?param=aux i have blocked traffic port 80 following command (we assume iptables rules list empty): iptables -i input -p tcp --dport 80 -m string --string "get /hello?param=aux" --to 70 --algo bm -j drop it's straightforward think ssl version (at least non-expert me): iptables -i input -p tcp --dport 443 -m string --string "get /hello?param=aux" --to 70 --algo bm -j drop however not working. ideas of doing wrong? in advance. it never work, since traffic ssl site encrypted, including request method , parameters.