Posts

Showing posts from January, 2012

menubar - How to remove android menu bar? -

Image
here add screen shot of application, want hide menu bar below screen. how can ? plz help you need specifiy targetsdkversion in manifest higher or equal android 3.0 button disappears (instead optionsmenu entries - if - shown in actionbar): <uses-sdk android:minsdkversion="8" android:targetsdkversion="17"/> if want hide complete navigation bar (including "back", "home" etc) can this code: getwindow().getdecorview().setsystemuivisibility(view.system_ui_flag_hide_navigation); but user taps screen visible again.

javascript - Canvas object and multiple instances inside another object? -

i have canvas object can call so var canvas = new canvas(); the canvas object has alot of functions in prototype. object creates canvas element, few functions such setwidth , getcontext etc. i have layer object canvas added functionality. thought idea set layer 's prototype canvas . worked great , good. the problem starts when want use multiple layers, each layer should have own canvas. canvas layers prototype, prototype points 1 canvas element. when start using multiple layers, canvases overwritten canvas element in layers prototype points same canvas object. i hope far made sense! i know add canvas layer property, instead of doing, layer.setwidth(900); i have do layer.canvas.setwidth(900); i guess question is, how can inherit canvas objects functions on instantiating new layer create new canvas element it? as requested code (simplified) var carl = {}; carl.canvas = (function() { "use strict"; function canvas(config) {

javascript - How to sum selected rows in table using jQuery? -

there table sum | <input type="text"> | <input type="text"> | | <input type="text"> | <input type="text"> | | <input type="text"> | <input type="text"> | sum | <input type="text"> | <input type="text"> | | <input type="text"> | <input type="text"> | foo | <input type="text"> | <input type="text"> | bar | <input type="text"> | <input type="text"> | i want sum of columns below "sum row" when input value changed. if there other column ex foo bar shouldn't count sum. what aproach here? dummy idea: every column has reference value summed. fiddle quick start: http://jsfiddle.net/igos/vnxzu/ edit should sum till next sum row right. row 0 col 0 = row 1 col 0 + row 2 col 0 row 0 col 1 = row 1 col 1 + row 2 col 1 row 3 col 0 =

postgresql - Postgres split timestamp column to time column and date column -

hi title says have column named healthtime in table of type timestamp without timezone i.e. healthime 2012-02-02 08:15:00 i split 2 new columns in same table, 1 date column , 1 time column i.e. date time 2012-02-02 08:15:00 please can advise me how (preferably in single query), thanks, james not 1 query, 1 transaction... should fine well: my table looks like: create table d (t timestamp); code changing table: begin; alter table d add column dat date; alter table d add column tim time; update d set dat = t::date, tim = t::time; alter table d drop column t; commit;

accessibility - How to tell a screen reader to use an attribute instead of the link text? -

i have link within unordered list follows: <li class="savelink"> <a href="/save"><span>save</span></a> </li> normally screen readers read "save". possible, , attribute, change without changing actual link text? the business need have link, styled icon. icon complementary link text. example: an icon of "+" sign , link text "menu" equal "add menu item" action. i tried aria-label, no success. try <a href="/save" aria-label="poot"><span aria-hidden="true">save</span></a>

Load data in bulk into cassandra -

lets have significant amount of data in excel. want load in cassandra column family ? how this? if looking sql*loader thing (bulk loader), cassandra has sstableloader . you can know more sstableloader here

javascript - Facebook Auth Dialog: Developer warning concerning the use of "display" type "popup" -

Image
starting today receive developer warnings in auth dialog following message: you using display type of 'popup' in large browser window or tab. better user experience, show dialog our javascript sdk without specifying explicit display type. sdk choose best display type each environment. alternatively, set height , width on window.open() call size dialog if have special requirements precluding using sdk. message visible developers of application. we have following situation: with javascript open new popup the src of popup set facebook's php-sdk method getloginurl popup has size of 400px 580px the php-sdk references proper use of "display=popup" within it's own code: if using generated url window.open() call in javascript, can pass in display=popup part of $params. the js-sdk documentation says, maximum-size of opened popup should 400x580: for use in browser popup no bigger 400px 580px. use display type maintain context user wi

excel - Split a row into several rows while maintaining formulae -

i have table looks this: id1 |id2 | month 1 | month 2 | month 3 |analysis item number|item type|column1|column2|column1|column2|column1|column2|ac1m1|ac1m2 the practice has been add each month's data new columns inserted before final analysis. add column in analysis field applying formula of new columns inserted. have other sheets linked data provided in analysis. as time passes , have more months it's little hectic maintain , not intuitive thinking of changing format this: item number|item type|column1|column2|month|analysis the item number , item type duplicated each month , rest of columns unique. what want change format while maintaining linked formulas, there easy way this? also, best way represent data? @momobo analysis formula. take 2 types of reading each both automatically , locally, 1 of columns in analysis checks see did reading on particular month. check variance in reading between local reading , automatic readin

java - Running a .jar file in a command prompt from double click -

i'll start of saying im on windows 7. i have created .jar file executes fine command line using - java -jar myjar.jar approach but i'm after able double click on jar file , open command prompt window , run in command prompt if i've typed java -jar myjar.jar line. when double click jar file think running because visual part of java appearing, there no command prompt window showing console output. after looking around i've come across people saying javaw jar files associated don't have console , need associate jar files java.exe instead of javaw.exe. i've tried , didn't seem work. can help? step step nice. this imho not possible. open console application itself, os-dependent. if need console open, have run application do.

Mysql error echoing the variable -

i have mysql query below - $id_order_last="15"; $id_order[]=array(); $sql1="select * `ps_orders` `id_order`> $id_order_last order `id_order`"; echo $sql1; $result1= mysql_query($sql1); $cnt=1; while ($row = mysql_fetch_array($result1)) { /*$id_order[$i]=$row['$id_order'];*/ echo $row['$id_order']."<br />"; $cnt++; echo $cnt."<br />"; } as can see have $id_order_last set 15 displaying value 15 when echoed. check sql echoed , display select * `ps_orders` `id_order`> 15 order `id_order` so in sql, run in phpmyadmin , tuples returns correct value. show result means 17 , 18 in database. means query correct! then echoed 2 , 3 cnt++ value while $row['$id_order'] still empty <br /> shown space. though tried loop print whole things still not showing up? $i=1; for($i;$i<=$cnt;$i++) { echo $id_order_last.

How to test Paypal account? -

i want test paypal account. have created merchant's account , personal account. want test if possible transfer (virtual) money personal account business (facilitator) account before going live. in advance it simple. login paypal sandbox , create new vendor , new buyer. give bogus emails , password them, though shouldn't need them. now virtual buyer can buy many products virtual vendor imaginary money want.

eclipse - Android compilation trouble after adding and removing BlackBerry SDK -

Image
i installed bb tools eclipse, added , removed bb nature 1 of projects. , now, can't compile (for android). eclipse told me troubles in androidmanifest.xml: native-code: armeabi androidmanifest.xml /vitocarsandroidapp androidmanifest.xml blackberry verifying problem but manifest ok, no 1 line highlighted: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.asap.vitocarsandroidapp" android:versioncode="5" android:versionname="1.04" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="17" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.call_phone" /> <uses-permission android:name="android.permission.read_phone_state" /> <applicat

git - Smartgit: Moving local changes from stash to branch -

Image
i have local changes have stored in stash. have (afterwards) created new branch , want push changes stash branch. smartgit: local > apply stash. when try smartgit asks me: restore index (checkbox), this? should select or not? the restore index option result in git stash apply --index . according the git man page , means: if --index option used, tries reinstate not working tree’s changes, index’s ones. however, can fail, when have conflicts (which stored in index, therefore can no longer apply changes originally). so, in general, yes, should try apply stash having option enabled.

uml - Associations between actors and usecases in the UML2 Metamodel -

Image
i'm trying understand rules defined uml2 metamodel associations between actors , usecases in usecase diagrams. understand actors , usecases can take part in generalizations (because derived classifier adds possibility generalization), , understand usecase can have extend/include-relationships other usecases (because directly defined in specification usecase diagrams). here part of metamodel diagram usecases: as can see, there no associations between actors , usecases @ in diagram. can mean associations allowed due common supertype of actor , usecase, perhaps behavioredclassifier or classifier. question is: which of meta(-classes) or elements in metamodel hierarchy responsible associations between actors , usecases? another thing confusing: there constraint says: an actor can have associations use cases, components, , classes. furthermore these associations must binary. but there no equivalent constraint defined usecases (except binary thing). mean associati

javascript - How to set height and width of a new window from code behind -

i have been trying hours opening new window , bound launch code behind not opening in new tab. want adjust height , width of window, unable set same. tried calling javascript function code behind , writing same in aspx page, no luck. i posting code: code behind: page.clientscript.registerstartupscript(typeof(string), scriptkey, "<script type='text/javascript'>window.open('../reportwebform.aspx?reporttype=report','height=50,width=2000,left=0px,top=0px,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');</script>"); if launch server calling aspx page javascript: function openwindow() { window.parent.open('../reportwebform.aspx?reporttype=report', 'width = 100%, height = 100%'); } try this note 2nd parameter name of window. height , width need give in 3rd parameter function openwindow() { window.open('../reportwebform.aspx?reporttype=report','', 'width = 100,

asp.net mvc - what does '~' mean/do in visual studio C# -

this question has answer here: what tilde before function name mean in c#? 7 answers finalize/dispose pattern in c# 13 answers while browsing code online i've come across following: ~disposable() { dispose(false); } this doesn't produce compiler errors, '~' doing in particular or why there? that called finalizer in c#. override finalize method using syntax similar destructor.

c# - Keyboard shortcut to switch between source and test files easily -

is there extension or keyboard shortcut moreunit eclipse in visual studio allow me quick switch between source file , unit testing file. also in eclipse, used create file (test or source) , hit ctrl+j , suggest me create opposite file , allow me switch between them ctrl+j . i don't know if there extension 1 eclipse. use ctrl + tab switch between current file , last one. of course works when open test file first , implementation, work way. i guess idea new extension.

How do we use Javascript function in PHP -

i using wordpress social media plug-in. when user clicks on icon opens link in new tab, want in new window, purpose using javascript function <script type="text/javascript"> // popup window code function newpopup(url) { popupwindow = window.open( url,'popupwindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes') } </script> but main problem code written in php , don't have idea how use javascript function in it. here php function. $out_button = array( 'tag' => 'a', 'class' => 'synved-social-button synved-social-button-' . $context . ' synved-social-provider-' . $button_key . $class_extra, 'data-provider' => $button_key, 'target' => $button_key != 'mail' ? '_blank' : '', 'rel' => &#

actionscript 3 - Invisible height in Flash's CheckBox when used in a ScrollPane for auto-calculation of height -

when using fl.controls.checkbox inside fl.controls.scrollpane , seems whenever last item in scrollpane's children container checkbox , scrollpane 's update() method leaves significant blank space below checkbox, although set size of checkbox. question : how remove invisible height checkbox? i've researched in many places , found useful post awesome person in link below. credits goes him, infineon. can't trace flash support forum referring though. http://www.actionscript.org/forums/showpost.php3?p=842806&postcount=6 the solution above invisible height problem hard find dig of flash as3 documentation doesn't turn override protected function configui():void method easily. @ least haven't found till now, , never have known either without kind of prior knowledge inner workings. * note :* solution doesn't work on checkbox . other form ui widgets fl.controls.radiobutton works same way. as noted below, because of package hard-coding wi

How to share 'r' plots over http -

Image
to share 'r' plot first convert image , share via email, shared folder etc... there alternative method sharing 'r' plots on web. user can visit dashboard , view crated 'r' plots via browser ? i believe looking shiny http://shiny.rstudio.org/

jquery - Resetting textfield by clicking an image -

i have image if clicked, other div opacity 0 using jquery. want if image clicked, reset textfield. here code. <div id=loginexit> <img class='loginexit' src='site_images/close.png'> </div> <div id=loginform> <div class=formc> <form name='loginform' action='loginc.php' method='post'> <font face='verdana' color=#d6d5d0 size=2> email address: &nbsp; <input type=text name='eadd' id=eaddtf style='width:150px;height:20px;border:1px solid #37749e;margin-bottom:5px;'> <br> password: &nbsp; <input type=password name='pass' style='width:150px;height:20px;border:1px solid #37749e;margin-bottom:5px;'> <br> <input type=submit value='login' class='login2' name=submit style='cursor: poi

opencl - ViennaCL on OS X: Can't copy data to GPU -

i'm learning work viennacl. first tries on cpu worked fine, trying use opencl. however, can't manage data onto gpu - while matrices seem created, don't contents: #define viennacl_with_opencl #define viennacl_with_ublas #include <boost/numeric/ublas/matrix.hpp> #include "viennacl/matrix.hpp" int main() { boost::numeric::ublas::matrix<float> data_cpu(1,1); data_cpu(0,0) = 1; viennacl::matrix<float> data_gpu(1,1); viennacl::copy(data_cpu, data_gpu); assert(data_cpu(0,0) == data_gpu(0,0)); } after this, data_gpu(0,0) 0 believe should 1 . i'm compiling g++ nocopy.cpp -framework opencl . using os x provided opencl driver. what doing wrong here? edit: removing viennacl_with_opencl fixes problem, not want. looks (my?) os x installation of opencl somehow broken. other, plain, opencl examples fail well: noname:histogram markus$ ./histogram opencl device vendor = nvidia, opencl device name = geforce

json - MergJSON error "...unexpected token near end of file"? -

i have simplest of scripts in livecode attempting parse small chunk of json using mergjson library. this doubtless stupid i'm doing it's been long day, can't json parsed livecode array: lc script in button called 'connect' function jsontoarray pjson local tarray,tkeys repeat each line tkey in mergjsondecode(pjson,"tarray") put jsontoarray(tarray[tkey]) tarray[tkey] end repeat return tarray end jsontoarray on mouseup put field "myjson" pjson answer jsontoarray() end mouseup my json { "firstname":"mary", "lastname":"smith", } the error: button "connect": execution error @ line n/a (external handler: exception) near "could not decode json: unexpected token near end of file" suggestions welcome.... thanks, steve mark b might have other thing you're not passing parameter jsontoarray... put jsontoarray(pjson) tarray put tarray["

javascript - How do I pass multiple attributes into an Angular.js attribute directive? -

i have attribute directive restricted follows: restrict: "a" i need pass in 2 attributes; number , function/callback, accessing them within directive using attrs object. if directive element directive, restricted "e" this: <example-directive example-number="99" example-function="examplecallback()"> however, reasons won't go need directive attribute directive. how pass multiple attributes attribute directive? the directive can access attribute defined on same element, if directive not element. template: <div example-directive example-number="99" example-function="examplecallback()"></div> directive: app.directive('exampledirective ', function () { return { restrict: 'a', // 'a' default, remove line scope: { callback : '&examplefunction', }, link: function (scope, element, attrs) {

jquery - Best method to create links to List Item's Workflow using results of SPServices - GetListItems -

i using spservices - getlistitems ajax retrieve data sharepoint 2010 kendo grid. bind title url template. works okay (except 1 grid's linkouts generates cross-site scripting error clicks through item. odd, because page , link in same site). i prefer link underlying workflow instance, cannot find unique id required in of results or underlying xml data (as viewed through stramit caml viewer) returned getlistitems. this feels clunky , hard-coded, , break if changes particular environments lists. in perfect world, able retrieve entire link listitem shows in sharepoint , emit in custom page. is there way this? edit list items retrieving library columns display links take item's associated workflow. want link directly workflow item displayed in grid, if looking @ document library in sharepoint. code: var carformdata = []; $(document).ready(function () { $().spservices({ operation: "getlistitems", async: false, listname: "car

mysql - Function Dependancy PHP -

so in php im trying public variable in database class connects database when class created. - <?php class database { public $_link; public function __construct (){ $this->_link = new pdo("mysql:host=localhost; dbname=swinkidc_student", "swinkidc_student", ""); } } and... <?php class user{ private $db; public function __construct() { $this->db = new database; } /** * returns id of user. * @param string $user * @return mixed */ public function getuserid($user){ $query = $_link->prepare("select `user_id` `users` `username` = :user"); $query->bindparam(":user", $user); $query->execute(); $result = $query->fetch(pdo::fetch_assoc); return $result['user_id']; } /** * checks if given user active. * @param string $user * @return bool returns true/false

c++11 - How do I iterate over collections generically in C++? -

simply put, if have set , vector how create generic method can handle both params. all want do, iterate on either types of collections. sounds should trivial i'm missing something. void printmesomestrings(somebaseclass<string> strings) { (auto& str : strings) { cout << str << endl; } } in c#, pass ienumerable or that. iterate on collection. any general reading explaining answer appreciated. the first option put code doing iterating in template. requires exposing implementation uses it, has disadvantages. basically, take type c template parameter, write code in terms of type c . template<typename c> void printmesomestrings(c&& strings) { (auto const& str : strings) { cout << str << endl; } } if want able have strong barrier between interface , implementation, c++11 approach engage in type erasure on for -iterable container, , expose for -iterable container, how std::function works

Having some problems creating multiple alarms on android -

i creating todo application user can create list of things remember do. when creating every instance in list set alarm go off when entrys deadline reached. alarms reciever creates notification, showing user deadline reached. the problem i'm having string i´m passing in intent notification doesn't update properly. first alarm functions well, every entry create following first gets same string passed first. my code setting alarm follows: alarmmanager = (alarmmanager) context.getsystemservice(context.alarm_service); intent intent = new intent(context, deadlineactivator.class); intent.setaction("todo" + system.currenttimemillis()); intent.putextra("todoname", name); pendingintent pendingintent = pendingintent.getbroadcast(context, (int)system.currenttimemillis(), intent, pendingintent.flag_update_current); am.set(alarmmanager.rtc_wakeup, deadline.gettime(), pendingintent); don't know if helpfull in way name of entry unique the onreci

clojure - Variable HTML template in Enlive -

i'm trying find 'enlivonic' way of defining function perform transformation on parameterised html template. in other words, how define defsnippet takes template argument? i looked @ at, snippet , transformation, i'm little lost in macros :-( if have transformation, want feed different templates, try: (defn multi-template [t] (template t [h1 h2] [:h1] (content h1) [:h2] (content h2))) this function, when called html template return function takes h1 , h2 arguments , substitutes them given template. call follows: ((multi-template "your-template.html") "heading 1 content" "heading 2 content") i used similar when had number of different picture gallery designs templates , wanted switch between dynamically. note: dynamically creates template each time, whereas deftemplate macro calls template once @ compile time. if slow, there things can optimise (see clojure, enlive, multi-site )

arrays - PHP: parse structured txt file -

i have text file has structure it. use php take of values keys in structure , add them array. value object. advice on function parse this? object: 32.5445213,-92.0041885 icon: 0,0,000,6,6,"dude 1 (wx)\n2013-05-14 14:05:45 utc\nstationary\nemail: dude@dude.com\nweb: www.dude.com\nmscas" text: 15, 10, 1, "dude 1" end: object: 34.2017555,-90.5699615 icon: 0,0,000,6,6,"dude 1 (wx)\n2013-05-14 14:05:45 utc\nstationary\nemail: dude@dude.com\nweb: www.dude.com\nmscas" text: 15, 10, 1, "dude 1" end: object: 42.1689987,-88.2949982 icon: 0,0,000,6,6,"dude 1 (wx)\n2013-05-14 14:05:45 utc\nstationary\nemail: dude@dude.com\nweb: www.dude.com\nmscas" text: 15, 10, 1, "dude 1" end: object: 48.1980019,-101.3073273 icon: 0,0,000,6,6,"dude 1 (wx)\n2013-05-14 14:05:45 utc\nstationary\nemail: dude@dude.com\nweb: www.dude.com\nmscas" text: 15, 10, 1, "kc0isw" end: object: 34.1373138,-88.7238998 icon: 0,0,000,6,6,"dud

ios - Creating a new MKPolygon from two intersecting polygons -

i know there 1 specific question talks bit old , wanted little more technical if possible. first of take @ screenshot: https://www.dropbox.com/s/f94q3qaxrog0ec9/intersections.png want want have happen "i see both intersect , happens not want draw 'parts' of polygon". in case draw both polygons not draw the 'path' of yellow polygon inside orange polygon. include not line fill color well. obviously gets tricky because aren't going have exact points along path of each polygon intersect other points along polygon path. can see screenshot, in order make possible, think, need points intersect. after , assuming can this, not know if there way use cgpathref class need do. going have re-create polygon according docs cant fill in unless closed path. how fill in polygon not interesecting without closing path?? the thing can think of "hide" parts of polygon intersect unsure how this. can offer help/insight problem?? here go. wrote obje

Getting a masterpage error in asp.net -

i trying add masterpage in asp.net getting error saying page contains markup not valid when attached masterpage. here masterpage file: <%@ master language="c#" autoeventwireup="true" codefile="masterpage.master.cs" inherits="pages_adminmaster" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <asp:contentplaceholder id="head" runat="server"> </asp:contentplaceholder> </head> <body> <form id="form1" runat="server"> <div style="text-align: right"> <asp:contentplaceholder id="contentplaceholder1" runat="server"> <asp:linkbutton id="linkbutton1" runat="server" oncli

mysql - Multi-conditional join -

i bet easy question mysql chops bit rusty. need little generating proper query following scenario multi conditional join. have 1 table attributes (think tags) , table have list of records. running problems when want match page has more 1 attribute defined in query. +--------------------------------------+ | attributes | +-----------+------------+-------------+ | name | value | page_id | +-----------+------------+-------------+ | type food 2 | | fruit apple 2 | | color green 2 | | type frog 3 | | color green 3 | +--------------------------------------+ +--------------------------------------+ | pages | +--------------+-----------------------+ | page_id | title | +--------------+-----------------------+ | 2 granny smith | | 3 kerm

regex - The correct syntax of a quantifier in a regular expression pattern with grep in Solaris? -

i have search in many files several lines, lines telephone number of ten digits. examples of lines: telephonenumber: 66727166501 telephonenumber: 6672716650 telephonenumber: 66727166 telephonenumber: 6672716651 so expecting lines: telephonenumber: 6672716650 telephonenumber: 6672716651 i using next grep instruction search: grep '^telephonenumber: [0-9]\{10\}$' file.txt it works fine in ubuntu, opensuse , cygwin, when run in solaris, not match, if delete $ @ end of pattern, match, taking "at least 10 digits" any suggestions? the cause of problem simple, did not realize because, said, running command in diferent distributions no problem (i not know why) , not cheking files option in text editor the problem eol of files apply search, originals files did not have unix format, regrettably, creation of these files not under control

jquery - re initialize ckeditor after destroy without page reload -

how can re initailize ckeditor (4) after destroying instances dont have reload page. im destroying them clean inline divs before saving (see comments on why) content mysql via ajax here code: <!doctype html> <html> <head> <title>massive inline editing &mdash; ckeditor sample</title> <meta charset="utf-8"> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <script src="/ckeditor/ckeditor.js"></script> <script> // "instancecreated" event fired every editor instance created. ckeditor.on( 'instancecreated', function( event ) { var editor = event.editor, element = editor.element; }); </script> </head> <body> <!-- start container div --> <div id="container"> <div id="headerleft" contenteditable="true"><!-- start headerleft div --> <h2 id=&q

Getting integers from text file and work on array list in java -

i have text file contains: " have 3 apples , 1 banana. all people have 4 cars @ least." i want read .txt file , integers it.i strore integer variables in arraylist. public class dedede { public static void al() throws exception { file f = new file("c:\\users\\sony\\desktop\\456.txt"); try { filereader islem = new filereader(f); char data[] = new char[(int) f.length()]; islem.read(data); string metin = new string(data); arraylist<integer> yapi = new<integer> arraylist(); stringtokenizer s = new stringtokenizer(metin); string dizi[] = new string[s.counttokens()]; int = 0; while (s.hasmoretokens()) { dizi[i] = s.nexttoken(); i++; } (int c = 0; c < dizi.length; c++) { if (integer.parseint(dizi[c]) > 0) { yapi.ad

Using Git with a a current Eclipse project -

i use windows xp , eclipse indigo. have used tortoisegit pull , commit files 'til ease. how can integrate java project files in eclipse files pulled git? after pulling files git, copy files manually folder of git replace files in eclipse project. is there better way this? don't move files. pull files want code located. use egit synch files directly eclipse. the same goes source control system (e.g. svn, cvs) , ide (netbeans, intellij). copying files , forth doesn't make sense.

sql - How to assign value to columns from StartDate to EndDate when StartDate is a fixed date, e.g. Jan 2013 -

i have table this: country project invcode invname site workload startdate enddate usa 1234 2020 jane box 101 20 2012-02-10 2013-04-15 usa 1234 2020 jane box 102 35 2013-02-10 2013-07-15 usa 2222 2140 james smith 101 5 2012-10-10 2013-12-05 usa 2222 2590 susan falco 410 12 2013-05-10 2015-12-20 usa 2250 2140 james smith 401 8 2013-04-01 2013-07-18 i added 4 columns table: startyear, startmonth startdate , endyear, endmonth enddate (hopefully in writing query) startyear startmonth endyear endmonth 2012 2 2013 5 2013 2 2013 7 2012 10 2013 12 2013 5 2015 12 2013 4 2013 7 the desired output this. couldn't fit months should go max month-year enddate. in table have columns jan 2013 through dec 2015 country|project|invcode|invname|site|startdate|enddate|jan-13|feb-13|mar-13|apr-13|may-13|. usa|1234|2020|jane box |101|2012-02-10|2013-05-15| 20 20

sql - Group by Multiple columns and case statement -

i have present orderdata group month , card type year this: month cardtype order_cnt 201201 amex 10,835 201201 disc 6,542 201201 mc 2,675 201202 amex 66,817 201202 disc 36,581 201202 mc 165,683 the table can data has orders each day of month. used following sql group order count each day of month card type: ( select cardtype,orderdate,count (distinct(orderserialno)) tablename orderdate between '01-jan-2012' , '31-dec-2012' group cardtype,orderdate ) now need present data in above form using case statement have group month, not able that. can please help. thanks to group month can use: sqlserver: group year(datefield)+month(datefield) or oracle: group to_char(datefield, 'year') + to_char(datefield, 'month') so query: select cardtype,count (distinct(orderserialno)),year(datefield)+month(datefield) order_date tablename orderdate between '01-jan-2012' , '31-dec-2012' group card

css - Refer static images or fonts in stylesheet when developing extensions for Chrome -

i creating google chrome extension. , want use background-image attribute of elements define through css. not sure how url() should given. tried relative url, tries fetch image relative site's domain! not relative extension's source directory. the stylesheet included extension via manifest file follows: ... "content_scripts": [ { "matches": ["http://www.myblahblahsite.com/"], "js": ["core.js"], "css":["styles.css"] } ], ... also, same custom fonts using @font-face for example: @font-face { font-family: 'abccustom'; src: url("fonts/abccustom.ttf") format('ttf'); } this won't consider font's path relative extension! any ideas or suggestions? thanks. you need make absolute url extension, best way this: @font-face{ font-family: 'abccustom'; src: url('chrome-extension://__msg_@@extension_id__

grails - How to do a 'where' query on a GORM object with matching local variable names -

let's wish search grails domain object, , parameter values in local variables names match object's attribute names: def getperson(string firstname, string lastname) { person person = person.where { firstname == firstname lastname == lastname } } how can query written find person attributes match local variable values? i believe can use implicit delegate variable follows: def getperson(string firstname, string lastname) { person person = person.where { delegate.firstname == firstname delegate.lastname == lastname } } edit: isn't necessary according spec / test case , find explicit use of delegate easier read/understand.

javascript - Does Google Maps KML Layer Contain Maps Center Point -

i'm trying make sure maps center point in boundaries of kml layer, i've not been able find modified code here seems work, of course doesn't. from google maps api can't tell whether or not .contains() meant work kml layers, or if there similar method. ideas? // bounds of desired area var kmllayer = new google.maps.kmllayer(kmllayerurl, {map:map, suppressinfowindows: true, preserveviewport:true}); google.maps.event.addlistener(map, 'center_changed', function() { if (kmllayer.contains(map.getcenter())) { alert("withnin kml layer bounds"); } }); the kmllayer has method getdefaultviewport give default viewport overlay (the bounds map centered on display contents. getdefaultviewport() latlngbounds default viewport layer being displayed. the returned latlngbounds has contains method. you can't access of internal content of kmllayer.

c# - How can I make the beforeunload event fire only when a browser session is exited -

disclaimer - should note javascript pretty weak. i'm in process of inserting code website can cover scenario when user exits browser, gets prompted proverbial 'are sure want quit?' sort of confirmation messsage. i'm in process of trying implement piece of javascript on website: <script language="javascript" type0"text/javascript"> var foo = true; window.onbeforeunload = askbeforeexiting; function askbeforeexiting() { if (foo) return "are sure want leave page?"; } </script> the code not throws confirmation message when attempts exit browser made. however, throws confirmation when link portion of site clicked , other related events. is there way modify code capture browser closing scenarios only? scenario killing browser task manager or powershell command can't captured. want scenarios in current user session may exit browser. i've been looking on various samples across web , through code re

database - How to order by multiple fields in MySQL? -

i'm looking order data in specific way have explicitly laid out fields want appear first. basically, i'm looking return mysql query doing imagine might this: order field(brand,'toyota','honda','ford'), field(type, 'suv', 'sedan', 'coupe'), field(transmission, 'manual', 'automatic', 'cvt') simply said i'm looking way order things based on multiple fields. i've tried doesn't seem working. can done or after specify order of 1 field have order other things either asc or desc? thanks help! perhaps this? select brand, type, transmission tablename order case brand when 'toyota' 1 when 'honda' 2 when 'ford' 3 end asc, case type when 'suv' 1 when 'sedan' 2 when 'coupe' 3 end asc, case transmission when 'manual' 1 when 'automatic' 2 when 'cvt' 3 end asc http://www.devx.com/t

sparql - retrieve list of mathematics categories from dbpedia? -

is there way using sparql retrieve topics of in dpbedia? http://dbpedia.org/snorql/ that there way extract subfields of topics listed here: http://en.wikipedia.org/wiki/lists_of_mathematics_topics the broad topics lists here: http://dbpedia.org/page/category:fields_of_mathematics i list shows parent class , subfield. question 1: depends on how define topic.... can query instance skos:concept : select ?con { ?con skos:concept } limit 1000 see result question 2: can query skos:broader properties, like: select ?parent (?label ?sub) { { ?sub skos:broader <http://dbpedia.org/resource/category:fields_of_mathematics> . ?sub rdfs:label ?label . } union { <http://dbpedia.org/resource/category:fields_of_mathematics> rdfs:label ?parent } } see results retrieve list of next level of sub-fields of above fields with: select ?parent ?sub ?subsub { { ?sub skos:broader <http://dbpedia.org/resource/category:fields_of_ma

java - Excluding markup on lowercased parentheses letters -

a string can contain 1 many parentheses in lower case letters string content = "this (a) nightmare"; want transform string "<centamp>this </centamp>(a) <centamp>nightmare</centamp>"; add centamp markup around string if has lowercase letter in parentheses should excluded markup. this have tried far, doesn't achieve desired result. there none many parentheses in string , excluding markup should happen every parentheses. pattern pattern = pattern.compile("^(.*)?(\\([a-z]*\\))?(.*)?$", pattern.multiline); string content = "this (a) nightmare"; system.out.println(content.matches("^(.*)?(\\([a-z]*\\))?(.*)?$")); system.out.println(pattern.matcher(content).replaceall("&lt;centamp&gt;$1$3&lt;/centamp&gt;$2")); this can done in 1 replaceall : string outputstring = inputstring.replaceall("(?s)\\g((?:\\([a-z]+\\))*+)((?:(?!\\([a-z]+\\)).)+)",

Recognize CSS orientation in iFrame -

is possible iframe can recognize orientation of parent website? @ moment css media query working @ parent site. i tried fix issue sending post message iframe , change linked css file javascript: parent site: window.addeventlistener("orientationchange", function(){ var iframe = document.getelementbyid("plan_iframe"); iframe.contentwindow.postmessage({orientation: window.orientation}, iframe.src); }, false) iframe: <link id="changing_css" rel="stylesheet" type="text/css" href=""/> [...] window.addeventlistener("message", function(e){ var neworientationvalue = e.data.orientation; if(neworientationvalue == 90 || neworientationvalue == -90){ document.getelementbyid('changing_css').href="css/vertretung_ios_landscape.css"; } else{ document.getelementbyid('changing_css').href="css/vertretung_ios_portrait.css"; } }, false) this fix slow because

html - How to alter ie Browser Mode? -

Image
i found lot of links said adding <meta http-equiv="x-ua-compatible" content="ie=emulateie7" /> or older version of doctype forces browser compatibility mode. after repeated attempts many combinations, seems me alter document mode , not browser mode i bet if remove doctype tag or make invalid ie forced compatibility view. broken markup of sorts force mode. however, surely have other negative consequences non-ie browsers.

registration - Errors while registrate as user --php -

i going create registration in php shows me following errors: string(59) "insert users (username,email,password)values('','','')" duplicate entry '' key 'email' <?php $con = mysql_connect("localhost", "user", ""); if (!$con) { die('could not connect: ' . mysql_error()); } mysql_select_db("university", $con); $res = mysql_query("insert users (username, password, email) values('{$_post['uname']}', '{$_post['pwd']}', '{$_post['email']}')"); if (!$res) { echo "mysql error ->" . mysql_error(); } else { echo '<script type="text/javascript">alert(\'regjistrimi u krye me sukses!\')</script>'; } ?> this form in html. cant see may wrong <div id="containt" align="right"> <form action="<?php echo $_server['php_self

osx - Core Data: How to update an NSArrayController immediately after adding an NSManagedObject? -

i adding instance in core data. entity represented nsarraycontroller . access newly added instance through controller. a "skill" instance added , try access through selectaddedobject follows: -(void)addskill { [self selectaddedobject:[nsentitydescription insertnewobjectforentityforname:@"skill" inmanagedobjectcontext:self.managedobjectcontext]]; } - (void)selectaddedobject:(nsmanagedobject *)addedmo { [self.sectionarraycontroller setselectedobjects:[nsarray arraywithobject:addedmo]]; nslog(@"selected: %@", [self.sectionarraycontroller valueforkey:@"selectedobjects"]); } this seems work if add [self.managedobjectcontext processpendingchanges]; as first line of selectaddedobject: . once that, document seems forget still needs save, , quit app without addition being auto-saved. don't want force onto users! any ideas on way update array controller in other way

Rails: Get all associated models from has-many association -

i need associated models other associated model, on want run query first. for example, got post model , tag model. need posts, associated tags. there's no problem, if have 1 tag – call 'tag.posts', if have more, 1 tag – example, need somethink like: post.where(id: posttag.where(tag_id: some_ids).pluck(:category_id).uniq) i belive rails have built-in solution. so, knows it? my thought is: post.joins(:post_tags).where('post_tags.tag_id' => some_ids).uniq you can make scope easier reuse. don't think there built-in method situation.

ios - Change language used in copy/paste menu to something other than English -

i have set "localization native development region" "france" in info.plist. nevertheless, copy/paste menu on uitextfield still in english. not understand why, , guess app still in english. what setting need change make menu use french? i have solution problem. when run app developer, show english. when apple review it, change follow language device. i can set language developer in info.plist cfbundledevelopmentregion ja

javascript - jQuery's plugin Isotope, cutting parts of images -

firstable, being on page! working on application launcher. won't talk much. thing have is bugging. isotope bugged. you can watch yourself: http://cloudje.nl/beta/launcher.php thank taking @ ;). does have answer on question: why bugging? please, give answer if think know more , know how fix it. can view sourcecode of page below. it's dutch page , it's full of html/css errors, know. thanks, amanush! <!doctype html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <title>cloudje.nl, van harte welkom!</title> <meta name="description" content="cloudje.nl een manier om a