Posts

Showing posts from March, 2014

php - Copy & Paste URL Link -

php - Copy & Paste URL Link - does know how re-create url of current page , "paste" url automatically href tag this: <a href="--paste here--">click</a> thanks lot. you utilize following: <?php echo '<a href="http://'. $_server['server_name'] . $_server['request_uri'].'">this page</a>; ?> altough not re-create paste should current url of page. http://php.net/manual/en/reserved.variables.server.php php url hyperlink copy

SQL 2008 R2 SP2 Linked Server - Exclude certain databases -

SQL 2008 R2 SP2 Linked Server - Exclude certain databases - i have linked server , exclude 4 databases in link. there way "hide" them? users access via advertisement groups in. revoke advertisement groups? i set databases offline , disappeared linked view. these there reference only, made sense. sql linked-server

PHP echo not displaying inside of HTML tags -

PHP echo not displaying inside of HTML <h3> tags - on page, have bunch of info fetched sql database via php pdo. $query=$pdo->prepare("select `balance`,`followers`,`following` `users` `username`=?"); $query->bindvalue(1,$logged); $query->execute(); $followerslist=$query->fetch(); $userbalance=$followerslist['balance']; ?> <div class="span4"> <h3> <?=$userbalance;?> </h3> </div> the above displays nothing. blank. however, when remove <h3> tags, works! if echo $userbalance; outside of <h3> block, works well. if alter $userbalance equal random text instead of info set sql table, works within <h3> block. reason refuses display info coming sql table. yet, whenever echo "followers" , "following" within same <h3> blocks, works. clear, "balance" numerical value. found problem! inside "bootstrap.css...

java - OneToMany and JoinColumn annotations is separate -

java - OneToMany and JoinColumn annotations is separate - i'm using hibernate 3.2.1. in entity class i've seen annotations @onetomany , @joincolumns used together. these mean in separate? instance mean if annotated our entity class follows: @entity @table(name = "player_account") public class playeraccount { @id @generatedvalue(strategy = generationtype.identity) @column(name = "id") private int id; @manytoone(targetentity = player.class, fetch = fetchtype.eager) //without @joincolumn private player player; //get, set } please see says hibernate documentation it: http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html_single/ need 2.2.5.2. many-to-one section: @joincolumn attribute optional, default value(s) in 1 one, concatenation of name of relationship in owner side, _ (underscore), , name of primary key column in owned side. java spring hibernate spring-mvc

javascript - Google Visualization, can you assign the color of the slice based on a column's value? -

javascript - Google Visualization, can you assign the color of the slice based on a column's value? - i trying next assign color based on value, not working, assigning default values. methods works other chart types. bear in mind cannot utilize color in options because rows can come in different order. ideas? var info = new google.visualization.datatable(); data.addcolumn('string', 'status'); data.addcolumn('number', 'count'); data.addcolumn({type: 'string', role: 'style'}); data.addrow(['failure', 8,'color:#ee4a49']); data.addrow(['warning', 1,'color:#e3d157']); data.addrow(['success', 1,'color:#45b7af']); http://jsfiddle.net/zys27/15/ based on current api think may need preprocess info before passing google charts. var info = new google.visualization.datatable(); data.addcolumn('string', 'status'); data.addco...

javascript - Jquery Get Response Data Error -

javascript - Jquery Get Response Data Error - i have code calls buy.php , makes purchase , shows results. store.php <h4 class="result">result:</h4> function buy(id) { $.ajax({ method: "get", url: "buy.php?id="+id+"", success: function (data) { $(".result").html(data); } }); } buy.php (after many check finally) echo 'purchase successful!'; or echo 'purchase failed!'; when store.php calls buy.php this shows jquery makes request not buy.php page ( store.php ) , when phone call purchase function content on current page duplicates. why doing so? help? the url alternative ajax url , not url . javascript case-sensitive. function buy(id) { $.ajax({ method: "get", url: "buy.php?id="+id+"", // here ^ success: function (data) { $(...

javascript - get first word in java script websockets -

javascript - get first word in java script websockets - i using websockets in java script , string manipulation on message receive other end of websocket. strip off characters first word in message. illustration if message lets go party manipulate string lets . thinking go through string index index until nail first white space. not sure syntax in javascript. sound right or there improve way it? sorry if trivial quite new javascript. simple: var themessage = 'hello world!'; var thefirstword = themessage.split(' ')[0]; // 'hello' javascript string websocket substring

java - Converting BufferedReader to JSONObject or Map -

java - Converting BufferedReader to JSONObject or Map - my code sends request server, url obj = new url(url); httpurlconnection con = (httpurlconnection) obj.openconnection(); con.setrequestmethod("get"); con.setrequestproperty("user-agent", user_agent); bufferedreader in = new bufferedreader(new inputstreamreader(con.getinputstream())); i bufferedreader object prints, { "status": "error", "errorcode": "missing_params", "errormessage": null, "requestid": "20141014181739_11625805172", "downstreammoduleerrorcode": null, "object": [ "activity_code", "activity_name", "points", "frequency", "strategy", "vsa_app_access_token" ] } i want jsonobject or map this. tried converting string , manipulati...

wpf - Context Menu Binding to Parent Window's Datacontext -

wpf - Context Menu Binding to Parent Window's Datacontext - i have treelistcontrol binds collection in vm. want define context menu within treelistcontrol having header text bind string in vm. how can set info context in case? tried <window.datacontext> <model:viewmodel></model:viewmodel> </window.datacontext> <grid> <button grid.row="1" command="{binding cellcheckedcommand}"></button> <textblock text="{binding headertext}" grid.row="2"> <textblock.contextmenu> <contextmenu> <menuitem datacontext="{binding relativesource={relativesource ancestortype={x:type window}}, path=datacontext}" header="{binding headertext}"></menuitem> </contextmenu> </textblock.contextmenu> </textblock> </grid> but doesn't work. here viewmodel public delegateco...

laravel - Why does Eloquent change relationship names on toArray call? -

laravel - Why does Eloquent change relationship names on toArray call? - i'm encountering annoying problem laravel , i'm hoping knows way override it... this scheme allows sales reps see inventory in territories. i'm building editor allow our sales manager go in , update store acl can manage reps. i have 2 related models: class store extends eloquent { public function storeaclentries() { homecoming $this->hasmany("storeaclentry", "store_id"); } } class storeaclentry extends eloquent { public function store() { homecoming $this->belongsto("store"); } } the thought here store can have many entries in acl table. the problem this: built page interacts server via ajax. manager can search in variety of different ways , see stores , current restrictions each acl. controller performs search , returns info (via ajax) this: $stores = store::where("searchcondition", ...

jsp - how can java return false when comparing 2 numbers which has exactly the same type and value? -

jsp - how can java return false when comparing 2 numbers which has exactly the same type and value? - this question has reply here: why equals() method when have == operator? [duplicate] 8 answers <br><% if (overlimit != null) {%><%=overlimititemno.getclass().equals(shoppingvo.getitem_no().getclass())%><%}%> <br><% if (overlimit != null) {%><%=overlimititemno.getclass()%> vs <%=shoppingvo.getitem_no().getclass()%><%}%> <br><% if (overlimit != null) {%><%=overlimititemno%> vs <%=shoppingvo.getitem_no()%><%}%> <br><% if (overlimit != null) {%><%=overlimititemno == shoppingvo.getitem_no()%><%}%> and shows next on browser true class java.lang.integer vs class java.lang.integer 300008 vs 300008 false you need utilize obj1.equals(obj2). == on obje...

php - Wordpress only show posts from specific author role -

php - Wordpress only show posts from specific author role - i want include filter loop, posts authors user role appear. want show them in category e.g "verified authors", need check if right category in loop aswell. this have got: functions.php function get_author_role() { global $authordata; $author_roles = $authordata->roles; $author_role = array_shift($author_roles); homecoming $author_role; } loop in category template <?php if(have_posts()) : while(have_posts()) : the_post(); //how check if author = specific role , check if category 'verifiedauthors" ? endwhile;endif; ?> you can add together author query loop. // illustration $atuhors_array = array( 1,4,5,3 ); $query = new wp_query( array( 'author__in' => $authors_array ) ); once must create array , add're looking authors array. $blogusers = get_users( 'blog_id=1&orderby=nicename&role=subscriber' ); // array of wp_user objects. forea...

string - C# How do I extract each folder name from a path? -

string - C# How do I extract each folder name from a path? - my path "\server\foldername1\another name\something\another folder\" how extract each folder name string if don't know how many folders there in path , don't know folder names? many thanks string mypath = @"..\folder1\folder2\folder2"; string[] directories = mypath.split(path.directoryseparatorchar); edit: returns each individual folder in directories array. can number of folders returned this: int foldercount = directories.length; c# string

angularjs - multiple CDN bundle in asp.net MVC -

angularjs - multiple CDN bundle in asp.net MVC - i have been trying bundle js files cdn single bundle so: bundles.usecdn = true; string cdnhost = "https://ajax.googleapis.com/"; bundles.add(new scriptbundle("~/bundles/angularcdn", cdnhost).include( "~/ajax/libs/angularjs/1.3.0-beta.17/angular.js", "~/ajax/libs/angularjs/1.3.0-beta.17/angular-cookies.js", "~/ajax/libs/angularjs/1.3.0-beta.17/angular-route.js")); bundletable.enableoptimizations = true; but maintain getting "angular undefined".. , when view source page loads main cdn url : <script src="https://ajax.googleapis.com/"></script> i tried set debug = false. what doing wrong ? the cdnhost parameter refers alternate url bundle when stored in content delivery network. cdn boundle supposed loaded 1 file , should contain combined content of files uploaded on...

website - What do I need to learn to build a e-commerce site? -

website - What do I need to learn to build a e-commerce site? - i pupil beginner in aspect. need advice need larn build own e-commerce website. , should larn first , then...! every answers help me alots. thanks. ok need database how-kwon backend. next need application langrage perl, php, java, ruby.. create web presents. need same how-kwon html css , graphics. if have many time need 2-3 year build it. or can start whit open e-commerce shop scheme magento. website e-commerce

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* - i've inherited doc publishing process takes docbook , builds html , pdf output, using apache fop both. project had been started, never completed. lots of tweaking, i've able of doc sets build (20+), except handful, , fail severe code 1 of these 2 conditions: "fo:flow" missing kid elements. required content model: marker* "fo:block" not valid kid of "fo:root" the xml output comes out of docbook , docbook-fop checks out well-formed. the fop error in 1 book, "endecagloss", example, points end of string: <fo:flow flow-name="xsl-region-body" start-indent="4pc" end-indent="0pt"/> here’s log output in case: [java] severe: javax.xml.transform.transformerexception: file:/scratch/publishing/hudson/jobs/build-main-endeca-documentation/workspace/serverdoc/w...

javascript - Run the count down or up function -

javascript - Run the count down or up function - i wrote function count downwards or numbers pressing button. @ : var timer; function counterfn(element,oldcount,newcount,speed) { if(isnan(speed)) speed=100; clearinterval(timer); if(oldcount===newcount) { element.text(newcount); return; } var counter=oldcount; timer=setinterval(function() { if(oldcount<newcount) { if(counter>newcount) clearinterval(timer); counter++; } else { if(counter<newcount) clearinterval(timer); counter--; } if(counter===newcount) { clearinterval(timer); } element.text(counter); },speed); } $('.button').on("click",function() { counterfn('.endelement',10,100,1); }); description of function attributes: element : element show result oldcount : start number newcount : end number speed :...

firefox addon - nsIProperty.get to something other than nsIFile - fastest way to get special path strings -

firefox addon - nsIProperty.get to something other than nsIFile - fastest way to get special path strings - is possible utilize nsiproperty.get special path other nsifile? tried nsisupportsstring doesnt work. there's gotta other nsifile should on right, why else create argument? im looking fastest way special path strings, because stuff happening on 200ms animation of panel element these times critical me. heres speed analysis: // fileutils.jsm :: getfile // average time: 3.85ms console.time('path'); var path = fileutils.getfile('defprofrt', []).path; console.timeend('path'); console.log(path); // nsidirectoryservice :: nsiproperties :: - nsifile // average time: 0.07ms console.time('path'); var path = cc["@mozilla.org/file/directory_service;1"].getservice(ci.nsiproperties).get('defprofrt', ci.nsifile).path; console.timeend('path'); console.log(path); // os.constants.path // average time: 0.12ms console.time...

javascript OOP concept issue -

javascript OOP concept issue - this question has reply here: how access right `this` / context within callback? 4 answers i have simple code : // can utilize either pixi.webglrenderer or pixi.canvasrenderer var renderer; var stage; var bunnytexture; var bunny; var game= {}; game.init = function() { }; game.init.prototype={ init:function(){ renderer= new pixi.webglrenderer(800, 600); document.body.appendchild(renderer.view); stage= new pixi.stage; bunnytexture= pixi.texture.fromimage("img/ninja.png"); bunny= new pixi.sprite(bunnytexture); bunny.position.x = 400; bunny.position.y = 300; stage.addchild(bunny); }, animate:function(){ bunny.rotation += 0.01; renderer.render(stage); requestanimationframe(this.animate); } } requestanimationframe(gam...

ios - Style of table view like on app LiveScore -

ios - Style of table view like on app LiveScore - i'm trying find open source style of table view shown on app livescore (https://itunes.apple.com/us/app/livescore/id356928178?mt=8), mean current header fixed , replaced next header when scroll out lines of current section. tried search not success. tell me one? any comments appreciated! ios uitableview

Java - Rotating array -

Java - Rotating array - so goal rotate elements in array right a times. example; if a==2 , array = {0,1,2,3,4} become array = {3,4,0,1,2} here's have: for (int x = 0; x <= array.length-1; x++){ array[x+a] = array[x]; } however, fails business relationship when [x+a] greater length of array. read should store ones greater in different array seeing a variable i'm not sure that's best solution. in advance. add modulo array length code: // create newarray before of same size array // re-create for(int x = 0; x <= array.length-1; x++){ newarray[(x+a) % array.length ] = array[x]; } you should create new array re-create to, not overwrite values, you'll need later on. java arrays rotation

xcode - CoreBluetooth entitlements in Mac App -

xcode - CoreBluetooth entitlements in Mac App - i trying build first mac app here. it's simple app doesn't have ui, relies heavily on corebluetooth. may first time developing os x day job developing ios i'm not stranger issues of development. up point, app not sandboxed, wanted test without issues. trying release , have had enable sandboxing. rely on corebluetooth have enabled bluetooth entitlement, when archive app , save mac app store bluetooth functionality doesn't work (it work if run straight xcode.). console shows next logs: 29/10/2014 00:23:10.782 appleeventsd[25]: sandboxed application pid 7652 attempted lookup app:"system events"/"com.apple.systemevents" 7655/0x0:0x92092 sevs1000 sess=100005 bundleid= denied due sandboxing. (___zl13handlemessagep17_xpc_connection_spv_block_invoke272()/appleeventsd.cp #2463) com.apple.root.default-qos 29/10/2014 00:23:10.819 sandboxd[118]: ([7652]) app(7652) deny appleevent-send com.apple.system...

angularjs - What is the lifetime of the cache when using the property in an $http get? -

angularjs - What is the lifetime of the cache when using the property in an $http get? - if set $http.get have cache this: $http.get(url, { cache: true}).success(...); then info stored. there object can check see data. lifetime of data? info lost when reload page in application? its keeping while live html page, if page has been closed or refreshed removed, if want clear cache should utilize $cachefactory provider's removeall() function, if want cache maintain long time should utilize localstorage or sessionstorage angularjs caching

java - always printing "println needs a message during " -

java - always printing "println needs a message during " - public class info { private static string product; public static string getdata() { homecoming product; } public static void setdata(string data) { product = data; log.d("data", product.tostring()); } } i getting object in below class: public class contact_details_tab extends fragment { textview hostel_name; jsonobject product; @override public view oncreateview(layoutinflater inflater, viewgroup container,bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.contact_details_tab, container, false); hostel_name = (textview) rootview.findviewbyid(r.id.hostel_name); product = data.getdata(); seek { hostel_name.settext(product.getstring("h_name")); } grab (jsonexception e) { log.d("data", e.getmessage()); }...

apache - How to check status of storm in java? -

apache - How to check status of storm in java? - now have configured storm cluster on local machine. know before starting storm have start nimbus supervisor , @ lastly ui storm commands. now writing java programme , want check status of storm cluster either working or not. like: if(stormworking()){ //do } else{ //do } now how can check storm cluster running or not? you can utilize monit[1] daemon philosophy , check .pid files. check each storm process need work properly: cat /etc/monit.d/storm check process storm-nimbus pidfile /var/run/storm/storm-nimbus.pid start programme = "/sbin/service storm-nimbus start" stop programme = "/sbin/service storm-nimbus stop" check process storm-supervisor pidfile /var/run/storm/storm-supervisor.pid start programme = "/sbin/service storm-supervisor start" stop programme = "/sbin/service storm-supervisor stop" check process storm-ui pidfile /var/run/storm/storm-ui.pid star...

Block Popups in webview used in android app -

Block Popups in webview used in android app - i have webview , sites loading in takes lot of time because of popups beingness loaded unnecessary evil me. want remove popup loading. help appreciated android-webview

javascript - Chrome Extension Message passing: response not sent -

javascript - Chrome Extension Message passing: response not sent - i trying pass messages between content script , extension here have in content-script chrome.runtime.sendmessage({type: "geturls"}, function(response) { console.log(response) }); and in background script have chrome.runtime.onmessage.addlistener( function(request, sender, sendresponse) { if (request.type == "geturls"){ geturls(request, sender, sendresponse) } }); function geturls(request, sender, sendresponse){ var resp = sendresponse; $.ajax({ url: "http://localhost:3000/urls", method: 'get', success: function(d){ resp({urls: d}) } }); } now if send response before ajax phone call in geturls function, response sent successfully, in success method of ajax phone call when send response doesn't send it, when go debugging can see port null within code sendresponse function. from the documentation chrome....

php - HTML form is no longer posting input data -

php - HTML form is no longer posting input data - i have 'subscribe' form on website uses ajax validate input fields, form processed via php. actual html code resides on wordpress page. reason, form no longer posts. no info posted myql, , no email sent or received. a status message on page appears , hangs @ "please wait while process information..." message in part of ajax code, thinking wrong php script? have 'contact' page uses identical code 'subscribe' pages uses validate input fields, , works. i able recover both ajax , php script before time when did work, uploaded server , nothing, form still not process. made sure database credentials right host, , tested connection mysql , able connect. next, made sure able send mail service host using next script: <?php mail('subscriptions@3elementsreview.com','test mail','the mail service function working!'); echo 'mail sent!'; ?> i don't know...

c++ - What type of array should I be using? -

c++ - What type of array should I be using? - i have project class , i'm not sure type of array should using program. have create stock market programme user buys, sells , views stock listings , checks business relationship balance. there 2 text files contain next data: class="lang-none prettyprint-override"> leon1111 5000.00 wise2222 10000.00 woo3333 3000.00 white4444 7000.00 head5555 4000.00 and class="lang-none prettyprint-override"> apple aapl 450.00 boeing ba 75.50 intel intc 22.30 rambus rmbs 5.55 sirius siri 3.15 skyworks swks 25.35 xilinx xlnx 36.80 this code i've written far: class="lang-cpp prettyprint-override"> #include <iostream> #include <fst...

jquery - Inserting a newly created div into the DOM -

jquery - Inserting a newly created div into the DOM - i want append div below, has 2 children, #galleryheader div in dom. <div class=open_folder_icon> <img class="folder_icon" src="images/folder_open.png" alt="open folder" /> <div class="folder_name" >root</div> </div> i want $('<div>').appendto(#galleryheader); but replace simple 'div' here more complicated div. there clean way that? thanks not sure question is, if append: it should go other direction using append : $('#galleryheader').append('<div>'); where <div> more complicated div string. see documentation here. alternately, should able do: $('<div>').appendto('#galleryheader'); in either case, need create sure #galleryheader in quotation marks since acting selector. if question creating complicated div: ...

Oracle regex expression containing "?" -

Oracle regex expression containing "?" - i have query uses regex look follows update user_master set first_name = ? whereuser_id = nvl(regexp_substr(?, '^(\[0-9]+|[0-9]+(\[0-9]*)?)$'), 0) for query execute have available gui interface me can pass required values seperated , field_value_1 field_value_2 here got error count of fields selected not match count of place holders in sql update section here expecting three field values since total number of ? three (two of them place holder , 1 within regex ) . how create functionality intact while ignoring ? within regex what happens if replace '^(\[0-9]+|[0-9]+(\[0-9]*)?)$' '^(\[0-9]+|[0-9]+(\[0-9]*)' || chr(63) || ')$' ? it's ugly may way trick badly written gui tool. regex oracle oracle11g

Set Oracle SQL Developer auto complete suggestions to lower case -

Set Oracle SQL Developer auto complete suggestions to lower case - i using oracle sql developer version 4.0.3.16, build main-16.84. problem when start typing table name (ex: employees, departments), auto finish appears upper case (ex: employees, departments) screenshot , without selecting of suggestions. annoying see suggestions last_value or last_day(sysdate) or last_day(sysdate) - sysdate when typing select last_name employees . @ university utilize older version of programme , there auto right hints in lower case , first 1 selected (so pressing tab accepts completion). forces me press downwards arrow , come in or tab take completion. my perfect code keyword in upper case , table names lower case, +the first completion suggestion should selected. is there setting or default feature of older version, while newer 1 lacks it? or maybe comes oracle express edition? thanks. not sure version 2.1 have alternative go tools> preferences>code edi...

javascript - CalendarExtender how to show only a few days -

javascript - CalendarExtender how to show only a few days - how create calendarextender show few days? other days must appear disabled. like example, theatre booking websites. thanks, javascript asp.net calendar ajaxcontroltoolkit calendarextender

php - ZF2 console error - Get was unable to fetch or create an instance for ViewRenderer -

php - ZF2 console error - Get was unable to fetch or create an instance for ViewRenderer - i have problem doctrine console. have mailservicefactory.php containing code: namespace application\service; utilize zend\servicemanager\factoryinterface; utilize zend\servicemanager\servicelocatorinterface; class mailservicefactory implements factoryinterface { public function createservice(servicelocatorinterface $servicelocator) { $i_render = $servicelocator->get('viewrenderer'); $a_config = $servicelocator->get('config'); homecoming new mailservice($i_render, $a_config); } } utilize zend\servicemanager\factoryinterface; utilize zend\servicemanager\servicelocatorinterface; class mailservicefactory implements factoryinterface { public function createservice(servicelocatorinterface $servicelocator) { $i_render = $servicelocator->get('viewrenderer'); $a_config = $servicelocator->get(...

sql - Error in stored procedure while join operation -

sql - Error in stored procedure while join operation - i have written stored procedure below create table #temp( tloaid int, tloaname nvarchar(50) ); -- drop table #temp; declare @string varchar(max) = 'casualty, insurance, debit,'; -- set @string = @loastringparam; select b.loaid tloaid, b.loaname tloaname #temp (select rtrim(ltrim(split.a.value('.', 'varchar(100)'))) info (select cast ('<m>' + replace(@string, ',', '</m><m>') + '</m>' xml) data) cross apply data.nodes ('/m') split(a)) bring together tbloa b on a.data = b.loaname; if(exists(select tbploa.loaid tbploa tbploa.loaid not in(select #temp.tloaid #temp) , pid= @pid)) begin .... .... end ... now it's throwing error message like incorrect syntax near 'a'. i not able trace error!!! please help me!!! try changing alias name this. create table #business (bid int,bname v...

syntax - Why does C# allow trailing comma in collection initializers but not in params? -

syntax - Why does C# allow trailing comma in collection initializers but not in params? - valid syntax: var test = new list<string> { "a", "b", "c",//valid trailing comma }; invalid syntax: private void test(params string[] args) { } test( "a", "b", "c",//invalid trailing comma ); is matter of syntax inconsistency or calculated decision? so i'll take stab @ though never know "true" reason wasn't on compiler team - , likelihood of 1 turning questionable. trailing commas useful in few scenarios, namely merging , code-generation. in context of stuff collection or property initialisers , enums, leaving trailing comma harmless (the compiler can safely infer "end of list" there closing block bracket can hook on to. method parameters quite explicit - compiler needs lot of command in area can provide feedback when people coding , other ancillary features...

unity3d - Issue using .Contains with application.loadedlevel/loadlevel -

unity3d - Issue using .Contains with application.loadedlevel/loadlevel - i'm working on script returns right scene when pressing escape. in dataupgrade, level select, transferdata(x) should homecoming startmenu, in startmenu should close game , in level(x) should homecoming transferdata(x). next script has been made help functionr. #pragma strict import system; function update () { if (input.getkey ("escape")) { var level : string = application.loadedlevel.tostring(); //var transferdata = "transferdata"; if(level == "startmenu"){ application.quit(); } else if(level == "dataupgrade"){ application.loadlevel("startmenu"); } else if(level == "level select"){ application.loadlevel("startmenu"); } else if(level.contains("transferdata")) application.load...

java - Programmaitcally adding nature to existing project -

java - Programmaitcally adding nature to existing project - when adjust project nature of running project workspacejob job = new workspacejob("addingnature") { @override public istatus runinworkspace(iprogressmonitor monitor) throws coreexception { seek { iprojectdescription description = activeproject .getdescription(); string[] prevnatures = description.getnatureids(); string[] newnatures = new string[prevnatures.length + 1]; system.arraycopy(prevnatures, 0, newnatures, 0, prevnatures.length); newnatures[prevnatures.length] = id; description.setnatureids(newnatures); activeproject.setdescription(description, new nullprogressmonitor()); homecoming status.ok_status; } grab (coreexception e) { logger.log(level.severe, warning_nature_fail, e.getmessage()); homecoming status.cancel_status; } } job.sc...

sql - convert time portion of date to an int -

sql - convert time portion of date to an int - i have column called enteredindate includes info such as: 2012-10-10 18:02:00 2012-10-11 13:30:00 2012-10-11 14:27:00 2012-10-12 14:14:00 how create new column has int info value next enteredindate column this? 1802 1330 1427 1414 use datepart : select datepart(hour, enteredindate) * 100 + datepart(minute, enteredindate) sql sql-server

swing - Java panel alignment -

swing - Java panel alignment - class cipherguiframe extends jframe { public cipherguiframe() { super("caesar cipher gui"); setdefaultcloseoperation(jframe.exit_on_close); setsize(400, 600); jtextarea area1 = new jtextarea(); jtextarea area2 = new jtextarea(); jspinner myspinner=new jspinner(); jpanel mainframe = new jpanel(); mainframe.setlayout(new boxlayout(mainframe, boxlayout.y_axis)); jpanel p1 = new jpanel(); jpanel p2 = new jpanel(); jpanel p3 = new jpanel(); p1.setlayout(new boxlayout(p1, boxlayout.y_axis)); p2.setlayout(new boxlayout(p2, boxlayout.y_axis)); p1.setborder(borderfactory.createtitledborder("cleartext")); p2.setborder(borderfactory.createtitledborder("spinner")); p3.setlayout(new boxlayout(p3, boxlayout.y_axis)); p3.setborder(borderfactory.createtitledborder("ciphertext")); p1.add(area1); p2.add(myspinner); p3.add(area2); mainframe.ad...

parsley.js - Is it possible to get call back value from form submit event -

parsley.js - Is it possible to get call back value from form submit event - i contending problem, want phone call jquery function when form submit event homecoming true, form submit event listener added parsley jquery plugin. so, how can homecoming value form submit event.please help me. parsley.js

javascript - Using custom variable in GA event tracking -

javascript - Using custom variable in GA event tracking - i trying custom variable event tracking in dynamic templating system. uses info url utilize variable. there nil coming across analytics script appended. can see wrong it? jquery(function icatgafunction() { jquery('#catbanner').click(function () { var url = jquery(location).attr('href'); // current url var icat = url.substring(url.lastindexof('/') + 1); // lastly index of url icat reference _gaq.push(['_setcustomvar', 1, 'icatbanner', icat]); // ga snippet }); }); jquery('#catbanner').find('a:first').attr('onclick', 'icatgafunction()'); // wrap first href around <img> , phone call function onclick i followed instructions here - perhaps scope? https://developers.google.com/analytics/devguides/collection/gajs/methods/gajsapibasicconfiguration#_gat.ga_tracker_._setcustomvar javascript jquery google...

javascript - Html form submit button not calling succes method? -

javascript - Html form submit button not calling succes method? - html form: <form class="form-horizontal" id="contactfrm" onsubmit="contactus()"> <fieldset class="scheduler-border"> <!-- form name --> <legend class="scheduler-border">fill contact details</legend> <!-- text input--> <div class="form-group"> <label class="col-md-4 control-label" for="fname">first name</label> <div class="col-md-6"><input id="fname" name="firstname" type="text" placeholder="first name" class="form-control input-md" title="enter first name" required="required"></div> </div> <!-- text input--> <div class="form-group"> <label class="col-md-4 control-label" for="lname">last name</label> <div class="...

javascript - placing items at the beginning of an array -

javascript - placing items at the beginning of an array - i got select element, multiple items. i'm supposed place values start '_' @ origin of list, ordered alphabetically. tried doing unshift() javascript method didn't work. there other way this? html: <select multiple="multiple"> <option>_c</option> <option>b</option> <option>_v</option> <option>a</option> </select> script: $(document).ready(function() { var = []; $('option').each(function() { a.push($(this).text()); }); $('option').each(function() { var v = $(this).text(); var s = v.substring(0,1); if (s == '_') { a.unshift($(this).text()); } }); a.sort(); (i = 0; < a.length; i++) { $('option').eq(i).text(a[i]); } }); it outputs following: _c _c _v _v as can see, scrambles values , losts reference ones without '_'. alphabetically speaking, ...

beautifulsoup - python - bs4 grab only certain links -

beautifulsoup - python - bs4 grab only certain links - <a title="dynamic link" href="test.php">text</a> how can grab ones have title tag illustration above? you can utilize select method commonly-used css selector: >>> bs4 import beautifulsoup >>> html = ''' ... <html> ... <body> ... <a title="dynamic link" href="test1.php">text</a> ... <a href="test2.php">text</a> ... </body> ... </html> ... ''' >>> soup = beautifulsoup(html) >>> soup.select('a[title]') [<a href="test1.php" title="dynamic link">text</a>] python beautifulsoup

how to partition mst of iris dataset to obtain sub graphs in r -

how to partition mst of iris dataset to obtain sub graphs in r - i'm new r , can give thought of how obtain sub graphs iris dataset mst tree? here have done little code obtaining mst tree iris dataset.. dono how proceed farther obtain sub trees of original mst tree.. here code.. library(cluster) library(igraph) data<-(iris) g<-graph.data.frame(data,directed=false) plot(g,layout=layout.fruchterman.reingold,edge.label=e(g)$weight) mst<-minimum.spanning.tree(g) plot(mst,layout=layout.reingold.tilford,edge.label=e(mst)$weight) r

machine learning - How can I export a gbm model in R? -

machine learning - How can I export a gbm model in R? - is there standard (or available) way export gbm model in r? pmml work, when i seek utilize pmml library, perhaps incorrectly, error: for example, code looks similar this: library("gbm") library("pmml") model <- gbm( formula, info = my.data, distribution = "adaboost", n.trees = 450, n.minobsinnode = 10, interaction.depth = 4, shrinkage=0.05, verbose=true) export <- pmml(model) # , export xml and error is: error in usemethod("pmml") : no applicable method 'pmml' applied object of class "gbm" i've tried passing in dataset. in case, live format can parse programmatically (i'll scoring on jvm) pmml great if there way create work. you can job using r2pmml package. currently, supports regression (ie. distribution = "gaussian" ) , binary classification (ie. distribution = "...

c# - how to retrieve the date via session variables? -

c# - how to retrieve the date via session variables? - so here scenario: page1.aspx: i created read-only textbox, followed simple calendar. on selecting date, long date appears in textbox. page1.aspx.cs: created session , stored date in it. page2.aspx: created label field house date value. page2.aspx.cs: now want rerieve date value label. problem1: on selecting date calendar, page refreshes , info reflected textbox problem2: can't convert , store date values label. please help. datatype variable=(datatype)session["sessionvariable"]; retrieve typecasting session value appropriate type. for example: date variable=(date)session["date"]; c# asp.net date label

node.js - Mongoose: assign field of type 'array of Strings' -

node.js - Mongoose: assign field of type 'array of Strings' - i'm using array of strings save emails: var user = new schema({ // other fields... emails: [string] }); have troubles updating field. say, email1 , email2 values receive view: works well: user.emails = [email1, email2]; user.save(); // fields updated, and doesn't: user.emails[0] = email1; user.emails[1] = email2; user.save(function(err, saveduser) { console.log(saveduser.emails); // updated array [email1, email2] // if retrieve user, 'emails' field not have above changes. }); but, strangely, works: user.emails = [email1]; user.emails[1] = email2; user.save(); // user.emails == [email1, email2]; can explain why happening? it's not documented, when manipulating array fields need create sure you're triggering mongoose's field alter detection knows array has been modified , needs saved. directly setting array element via index in square brack...

html - CSS Distribute li over 2 rows, unlimited items -

html - CSS Distribute li over 2 rows, unlimited items - i want li's distributed on 2 rows this: item 1 item 3 item 5 item 7 item 9 .... item 2 item 4 item 6 item 8 ...... my css bad have no clue on how accomplish , can't find on this... tried stuff , odd items, can't figure out how forcefulness items below odd items. you can utilize :nth-child selector select odd elements in list items. here example: css ul { position: relative; white-space: nowrap; } li { display: inline-block; list-style-type: none; padding: 0px 5px; } li:nth-child(2n) { top: 100%; position: absolute; margin-left: -36px; /* changes per width of first element */ } working fiddle html css list

sql server - SQL statment, Sum the number of occurrences, Group them and Order them from highest to lowest according to the number of occurrences -

sql server - SQL statment, Sum the number of occurrences, Group them and Order them from highest to lowest according to the number of occurrences - i having problem creating study pulling info database using sql-server. have 3 tables: incident, action , agency. within incident table have attributes such primary key (incident_id) , others (status , action_id). in action table have foreign keys (incident_id , agency_id) primary key (action_id). in agency table i have primary key (agency_id) , other attributes such (agency_name , agency_type). i need sql statement groups according type, sums number of actions incident has , orders them highest lowest, status closed. any help appreciated. time. using mysql syntax, next should help along way: select ag.agency_type, count(ac.action_id) incident inner bring together action ac on i.incident_id=ac.incident_id inner bring together agency ag on ac.agency_id=ag.agency_id i.status='close...