Posts

Showing posts from June, 2014

javascript - CSS help request for DIV placement and scrolling -

Image
i trying emulate 4 framed page divs, have encountered problems cannot resolve ... here quick sketch: here css use style divs: #wrapper { width: 100%; height: 90%; margin: 0 auto; } #leftpane, #rightpane { border: 1px solid black; float: left; color: white; background-color: white; height: 90%; top: 5%; } #leftpane { position: absolute; left: 0; bottom: 0; width: 50%; } #rightpane { position: absolute; left: 50%; bottom: 0; right: 0; } #topmenu { position:fixed; top:0px; height:5%; background-color: gray; } #footer { position: fixed; bottom: 0; left: 0; width: 100%; } and here divs create: <div id="wrapper"> <div id="topmenu"></div> <div id="leftpane"></div> <div id="rightpane"></div> </div> <div id="footer"></div> the content of div set via ajax call

datetime - LINQ to SQL convert serverTime to localTime -

i using linq sql query in order retrieve list of objects db. query quite big , several calculations , joins between different tables. before retrieving several data want check if object date equal or greater localtime of user. have created dictionary based on timezoneid finds offset each timezone. try add offset server time in order obtain localtime. when try add hours servertime, following error occures: could not translate expression 'invoke(value(system.func`1[system.datetime])).addhours(convert(<>h__transparentidentifier41.offset))' sql , not treat local expression. i know error caused offset value. have no idea how fix or how convert servertime localtime each object retrieved db in linq sql. want inside query in order avoind additional foreach loops. a sample of used code can seen below. public static func<datacontext, int, datetime?> getlastdataquery = compiledquery.compile((datacontext db, int id) => (from ob

r - Removing rows with * prefixed string -

i have data frame given below 85 p 74 p 70 p 35 p 38 p 54 49 p 35 p 30 p 50 p 30 p 30 104 p 69 p 50 p 70 p 70 p 87 *44 p *35 p 8 f 10 f 9 f *37 *53 p 30 p *40 p 30 p *48 p *73 76 p 86 p 69 p 84 p 66 p 79 110 p 65 p 40 p 57 p 57 p 74 i need remove rows have string starting * using r. tried gsub , sqldf couldn't resolve it. something : df2<-df[!apply(df,1,function(rg){any(grepl("^\\*[a-za-z1-9]",rg))}),] should work

php - Drop down menu appearing behind images -

i can't life of me figure out why drop down when hovering on "about" menu item appearing behind images, see link http://www.ziprfit.com.au/index.php (i hope it's ok post link). all search results suggest z-index, z-index images in there goes 6, , i've set menu 100 , still appears behind images. on server side generated php. thanks help. add position: relative; in #nav ul ul #nav ul ul { z-index: 100; display: none; position: relative; }

proc - How can I add sql statement in C/C++ Eclipse Editor? -

i need add few sql statement in c/c++ editor because i'am using pro*c/c++ how can add in c/c++ editor using eclipse? i using eclipse kepler i have found edit plus ( https://www.editplus.com/ ). it's text editor suports new syntax added user. there syntax file "proc or c embedded sql" (proc) : ( https://www.editplus.com/dn.php?n=proc2.zip ).

ruby on rails - Display attributes in loca ltime in ActiveAdmin Admin panel -

i using activeadmin in ruby on rails application , need display time attributes created_by_id , updated_by_id in localtime not know how write in activeadmin formtastic dsl . following current code listing: show |channel| attributes_table row :created_by_id row :updated_by_id you can set default time_zone in active_admin initializer ( config/initializers/active_admin.rb ) file this: config.namespace :admin |admin| admin.time_zone = 'eastern time (us & canada)' end please refer link: how change how activeadmin displays time (every time)

.net - c# object behaviour with polymorphism -

i'm trying solve problem involving polymorphism that's giving me headaches. code this: public abstract class base { public int val {get;set;} public virtual bool merge(base obj) { return false; } } public class : base { public override bool merge(base obj) { /* if obj of type sum "val" , return true, otherwise retur false */ } } public class b : base { public override bool merge(base obj) { /* if obj of type b sum "val" , return true, otherwise retur false */ } } public class composite { list<base> objects; public void addobject(base obj) { foreach(base b in this.objects) { if (b.merge(obj)) return; } this.objects.add(obj); } } what i'm trying achieve is, upon adding obj composite class, make object being added "merge" same type, otherwise add list. i'd code behaviour without using 'if' statements or checking object

rails - how to unistall ckeditor from rails -

first installed ckeditor, found simple text editor , want remove ckeditor. there word on how it. of course, can remove gem gemfile , run bundle , how can removed ckeditor files? you have inserted application.js , application.css file - remove require ckeditor stuff. then remove gemfile . run: bundle exec gem uninstall gem_name also if have assets precompiled run: rake assets:clean assets:precompile rails_env=production to remove public js , css files. if still encounter ckeditor files in public assets folder run: rake assets:clobber , compile again.

Android Studio : emulator is already running -

Image
i trying run emulator on android studio 8.14. when click run says running. appreciated. you don't have delete emulator when happens. files delete should have ".lock" extension: you don't need touch configuration files.

IOS drag one view to another view ipad app -

Image
i have create new ipad application image left side view have 1 tableview , right side in second viewcontroller client need when user drag row table view secondview controller make new view in second view if hope link drag , drop ipad applecation please share me , , 1 more 2 section ipad application , left side have tabbar please share me

RabbitMq + Masstransit queues -

in part of tutorials mentioned publisher , subscriber should have different queues. why so? will work 1 queue? masstransit not work multiple bus instances assigned queue. each instance grab next message - each bus gobble other bus' messages. ends in bad place. if there no consumer registered given message type, message rejected error queue. leaves errors , no indication why things erroring or messages aren't showing right. now if doing competing consumers load balancing have multiple buses on same queue - should exact copies of each other , done load balancing.

android - Instagram Rest API user Relationship -follow/unfollow error -

am stuck instagram issue. requesting target user follow/unfollow . have tired using in 2 ways . none of them worked. asynchttpclient client = new asynchttpclient(); client.settimeout(constant.timeout); 1 client.post( "https://api.instagram.com/v1/users/" + userid2 + "/relationship?"+ "access_token=" + utils.getfromuserdefaults(mcontext, constant.param_accesstoken)+"&action=follow", new followinstagramresponsehandler(true, position, holder)); but url worked in browser error: {"meta":{"error_type":"apiinvalidparameterserror","code":400,"error_message":"please supply action=follow,unfollow,approve,ignore,block,unblock"}} 2 requestparams params = new requestparams(); params.put("action",

sql - Select distinct returns duplicates -

i have following query: select distinct (tk.ticketid), tk.description, tk.creationdate, tk.reportedby, tk.owner, wf.assigncode ticket tk inner join wfassignment wf on wf.ownerid = tk.ticketuid tk.status not in ('ЧЕРНОВИК', 'ЗАКРЫТ', 'ВЫПОЛНЕН') , wf.assignstatus not in ('complete', 'inactive') order tk.ticketid; but returns duplicates in tk.ticketid attribute. , if remove other attributes ok. e.g. tk.ticketid tk.description tk.creationdate tk.reportedby tk.owner wf.assigncode О1013249 Право доступа 02.06.14 chernovdk skachkovsv novikovva О1013249 Право доступа 02.06.14 chernovdk skachkovsv prituladv О1013249 Право доступа 02.06.14 chernovdk skachkovsv sveshnikovav m.b. question simple can't solve myself. greatfull kind of help. try this: select tk.ticketid, tk.description, tk.creationdate, tk.reportedby, tk.owner, max(wf.assigncode) ticket tk inner join w

Different actions on different lines of a string in RUBY -

i have following string: aaaaaa; bbbbbbbb cccccc; cccccccc dddddd; dddddddd i need take different action in respect different lines. more precisely, must something-1 first line, something-2 other, , something-3 last one. pseudo code: out.each_line { |ln| if ln first somenthing-1 end if ln others somenthing-2 end if ln last somenthing-3 end } how about: lines = out.lines do_something_1(lines.first) lines[1..-2].each |line| do_something_2(line) end do_something_3(lines.last) this code action on first line, other action on lines except first , last, , third action on last line.

Rails: working on temporary instance between requests and then commit changes to database -

i have read rails - how temporarily store rails model instance? , similar questions cannot find successful answer. imagine have model customer , may contain huge amount of information attached (simple attributes, data in other tables through has_many relation, etc...). want application's user access data in single page single save button on it. user makes changes in data (i.e. changes simple attributes, adds or deletes has_many items,...) want application update model, without committing changes database . when user clicks on save , model must committed. for achieving need model kept rails between http requests. furthermore, 2 different users may changing model's data @ same time, these temporary instances should bound rails session. is there way achieve this? idea? and, if not, how can 1 design web application in changes in model cannot retained in browser in server until user wants commit them? edit based on user smallbutton.com 's proposal, wonder if se

android - spinner initialization in a custom view -

Image
i try make custom view i've got problem spinner. when launch application ok. preferences read , spinner setselection method work great (display picture ok). when change spinner value, there no problem : preferences saved , when start application new choice display. my problem comes when rotating device, spinner value reset last spinner value (vv2 in code). don't understand... here code : the widget_value_view.xml <?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android" > <spinner android:id="@+id/my_spinner" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centervertical="true" android:background="@android:color/transparent" /> <textview android:id="@+id/my_value_tv" android:layout_width="wrap_con

security - Usage of myBoolean = !myBoolean -

i've seen kind of statement few times in java code. example when wanting set button not visible in vaadin framework (or equivalent): boolean access = authorizator.isadmin(); access = !access; savebutton.setvisible(access); why not this: boolean access = authorizator.isadmin(); if(!access) { savebutton.setvisible(false); } your second example not same. sets button invisible, never sets visible. cleanest (imho) , functionally equal first be savebutton.setvisible(!authorizer.isadmin());

php - Phalcon Micro Application(facing prob with finish middleware event) -

i facing problem while implementing micro application in want middle ware executed after response send browser. mentioned in documentation of phalcon finish middle ware suppose work not working, browser still waiting complete whole process return response. my code like: $app->before(function() use ($app, $di) { $di->get('log')->log("this message before"); $di->get('log')->close(); }); $testctrl = new testctrl(); $app->get('/ctrltest', array($testctrl, "indexaction")); $app->after(function() use ($app, $di) { echo "after"; $di->get('log')->log("this message after"); $di->get('log')->close(); }); $app->finish(function() use ($app, $di) { $count = 100000; while ($count) {`enter code here` $di->get('log')->log("count " . $count); $count--; } }); the response coming after whole l

android - Fragment must be attached to a SherlockFragmentActivity -

ok have slight problem in code. public class menufragment extends sherlocklistfragment { is extending sherlock jar should allow me use action bar within fragment when run code getting caused by: java.lang.illegalstateexception: menufragment must attached sherlockfragmentactivity. so changed extends public class mainactivity extends actionbaractivity { to public class mainactivity extends sherlockfragmentactivity{ which runs code action bar no longer visible my fragment class, public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { sethasoptionsmenu(true); return view; } @override public void oncreateoptionsmenu(menu menu, menuinflater inflater) { super.oncreateoptionsmenu(menu, inflater); inflater.inflate(r.menu.menu_main, menu); } @override public boolean onoptionsitemselected(com.actionbarsherlock.view.menuitem item){ switch (item.getitemid()) {

sql server - Query performance comparision -

on mssql server, ran 2 queries returned same records different statistics. can guide me on 1 better use reporting purpose, following statistics: query 1: sql server parse , compile time: cpu time = 359 ms, elapsed time = 602 ms. (5517 row(s) affected) table 'worktable'. scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. table 'table1'. scan count 5972, logical reads 37742, physical reads 87, read-ahead reads 32, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. table 'table2'. scan count 1, logical reads 3061, physical reads 2, read-ahead reads 3084, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. table 'table3'. scan count 1, logical reads 4171, physical reads 2, read-ahead reads 4210, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0. table 'table4'. scan count 1, logical reads 843, physical reads

regex - How to REGEXP_REPLACE special character -

Image
i having issue following regex select regexp_replace(declinereasondesc, '(.+)(£)(\d+)', '\1\3 (gbp)') r declinereason t it not match following rows too expensive : less £100 expensive : more £200 expected outcome too expensive : less 100 (gbp) expensive : more 200 (gbp) edit: screenshot non-believers figured out myself problem £ sure suspected solution contains 2 steps first symbol code, if copy paste £ select ascii() dual not fly. have select symbol following correct code. select ascii(substr(declinereasondesc, 30,1)) declinereason t declinereasonid = 7; in case gave 49827 then select regexp_replace(declinereasondesc, '(.+)('||chr(49827)||')(\d+)', '\1\3 (gbp)') declinereason t; and works.

How do i connect facebook login to cordova application -

guys want connect facebook in application. using angularjs cordova/phonegap. have completed code part , tested in chrome , works fine. noticed run in android need add hash key facebook developers site did. after building phonegap build noticed connect facebook button doesnt launch facebook login page in webpage using chrome. happen beacuse not using facebook plugin cordova? add https in front of url using doesn't default file:// protocol: <script> (function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "https://connect.facebook.net/en_us/sdk.js#xfbml=1&appid=738518636191412&version=v2.0"‌​; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk'));

slideup - Create a panel that slides up and out of the screen in Android -

i need guidance. need make custom view touched , drag screen slides out of screen. have tried cool library: here dependend 2 layouts. 1 slided out , 1 remains after that. have buggy , ugly. public class demoactivity extends activity { private slidinguppanellayout mlayout; private relativelayout layout; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_demo); layout = (relativelayout) findviewbyid(r.id.panel); final int defaulttop = layout.gettop(); final int defaultbottom = layout.getbottom(); relativelayout dragview = (relativelayout) findviewbyid(r.id.dragview); mlayout = (slidinguppanellayout) findviewbyid(r.id.sliding_layout); mlayout.setdragview(dragview); mlayout.setpanelslidelistener(new panelslidelistener() { @override public void onpanelslide(view panel, float slideoffset) { } @override public void onpanele

virtualbox - Vagrant does not find virtual maschine -

vagrant not resume suspended maschine. instead creates new 1 everytime "vagrant up". running vagrant in debug mode gave me this: info subprocess: starting process: ["c:\\program files\\oracle\\virtualbox\\vboxmanage.exe", "showvminfo", "f7974dcf-1394-421a-a1c3-bce1ef352b2f"] debug subprocess: selecting on io debug subprocess: waiting process exit. remaining timeout: 32000 debug subprocess: exit status: 2147483651 debug virtualbox: vm not found! clearing saved machine id , reloading. when run "vboxmanage.exe showvminfo f7974dcf-1394-421a-a1c3-bce1ef352b2f", data maschine. how vagrant recognize , resume maschine? you manually add .vagrant.d/data/machine-index. recommend destroy box using vboxmanage.exe. vboxmanage.exe discardstate f7974dcf-1394-421a-a1c3-bce1ef352b2f and create new box.

android - Error:(26, 0) Gradle DSL method not found: 'runProguard()' -

i'm using android studio 0.9.3 gradle 'com.android.tools.build:gradle:0.14.+' apply plugin: 'com.android.application' android { compilesdkversion 19 buildtoolsversion '20.0.0' defaultconfig { applicationid "xxx.xxx.xxx" minsdkversion 16 targetsdkversion 19 versioncode 1 versionname "1.0.11" } signingconfigs{ releaseconfig{ storefile file("xxxxxxx") storepassword = "xxxx" keyalias = "xxxx" keypassword = "xxxx" } } buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' signingconfig signingconfigs.releaseconfig // adds version file name applicationvariants.all { variant -> def file = variant

How to compare array values in php? -

i need compare array values each other.these values unique ids. so, have check whether id values repeated. <?php $id=array("firstid2012","secondid2014","thirddid2010","fourthid2014"); $idcount=count($id); for($i=0;$i<$idcount;$i++){ //how compare?? } ?> if repeated id true, have change value of array value.so need know array value repeated also. if (count($idvalues) == count(array_unique($idvalues))){ //all values distincts } else { //there duplicated values $duplicated=array(); $visited=array(); foreach($idvalues $value){ if (in_array($value,$visited)){ $duplicated[]=$value; } $visited[]=$value; } $duplicated=array_uniq($duplicated); }

reporting services - How to sort SQL Server Report Builder Matrix Descending? -

Image
i have report following columns: machine shift reason minutesdown my sql statement datasource sorts shift descending. in query designer results sorted expect. when insert matrix (see images below) shifts not sorted descending. how manipulate report put shifts in order them appear ? once have created matrix, bring shift row group properties, like: in group properties, set sorting z a :

php - Wrap output with link from field in drupal views -

Image
i have view outputting list of nodes contain link, image , text. i want use link field wrap output (rather link node), can't figure out how raw url/title etc create create link in template. the field configured output url plain text, wrapped in div/spans regardless of style settings view field. views-view-fields--my-view.php: <a href="<?php echo $fields['field_link']->content ?>"> <?php foreach ($fields $id => $field): if ($id == 'field_link') continue; ?> <?php if (!empty($field->separator)): ?> <?php print $field->separator; ?> <?php endif; ?> <?php print $field->wrapper_prefix; ?> <?php print $field->label_html; ?> <?php print $field->content; ?> <?php print $field->wrapper_suffix; ?> <?php endforeach; ?> </a> this produces: <a href="<div class=" data-thmr="thmr_72"><div class="

java - EJB Timer runs to often in case of Exception -

in java ee application i'm using singleton bean @schedule worker method. calls statless bean pings server via soap. in case server down ejbexception gets thrown. shown in example service should run every 6 minutes, perfeclty works. pinged server down , exceptions occure service runs 1-2 times per minute. not statistiks , monitoring... can help? @startup @singleton(name="pingtimerejb") public class pingtimerejb { @ejb private iservice service; @schedule(hour = "*", minute = "*/6", persistent = false) public void dowork() { try { service.ping(); } catch (final exception e) {// nopmd // } } } setup: java 6, weblogic 12c, jre 170_71, ejb 3.1 before call service.ping() can try make low level tcp ip connection. example use clientsocket class. in way need store anywhere host , port.

Probability map of an image -

probability map of image can calculated bellow, may someone 1 we have probability matrix has probabilty each class. let x=[x1 x2 x3 x4] 4 classes 2 to probability map have 4 separate images each class. let class x1 x1=x1*255. pixel value labeling. 3 now each class multiply 255 each probability value , set value in image one. 4 as result have 4 gray scale images , these called probability maps. you generate 6 maps classes. or select 6 different colors, , use probability interpolate new color, 1 map.

html - How to make a snowboard (or squeezed rectangle) shaped div in css? -

Image
i trying shape: far have this . there way effect using css? thought negative radius work. div { display: inline-block; padding-top: 10px; padding-bottom: 10px; padding-left: 10px; min-width: 200px; border-radius:10% / 70%; background-color: red; } <div> board </div> i stuff mess around create things this. here how it. using :before , :after can create shape, use them create shape sit on top of div same colour background. make shape want. make :before , :after big , smaller size want (change width , height). div { display: inline-block; padding-top: 10px; padding-bottom: 10px; padding-left: 10px; min-width: 200px; border-radius: 20px; background-color: red; position: relative; } div:before, div:after { content: ""; display: block; width: 96%; height: 20px; border-radius: 50%; background: #fff; position: absolute; margin: auto; } d

functional programming - Immutable DataStructures In Scala -

we know scala supports immutable data structures..i.e each time u update list create new object , reference in heap. example val xs:list[int] = list.apply(22) val newlist = xs ++ (33) so when append second element list create new list contain both 22 , 33.this works how immutable string works in java. question each time append element in list new object created each time..this ldoes not efficient me. there special data structures persistent data structures used when dealing this..does know this? appending list has o(n) complexity , inefficient. general approach prepend list while building it, , reverse it. now, question on creating new object still applies prepend. note since xs immutable, newlist points xs rest of data after prepend.

Signalr client to retrieve missed messages on reconnect -

i user retrieve messages may have missed when re-connect signalr server. i know persist messages independently of signalr, keep track of last message id received in client , resend newer messages on reconnect looking @ sqlserver backplane's messages_0 table has payload , payloadid , wondering if there more signalr'y way backplane me or extend backplane me. do ideas how might go this? signalr more of real time message system used broadcast request connected clients. there isn't built in way track broadcasted message retrieved particular decoupled client if sending many clients. service bus/queue mechanisms more suited ie - msmq, rhino service bus, rabbitmq etc. can build queue handles requests , keeps eye on identities still connected hub , have signalr handle broadcasting portion of communication , if identity decouples , comes group resend identity. the thing going pure service bus method client have have protocol set on machines such msmq needing msmq

c# - Why is this call not passing the information from my xml file to the winForm? -

i'm newb , i'm lost. beg patience. i have working application believe serializing (??) xml file data using following code. public static string elementuser(object sender) { xmldocument xmldoc = new xmldocument(); //**edit:** call //locatefolder(sender, xmldoc); //instead of fileexistsrequest(xmldoc); fileexistsrequest(xmldoc); xmlnodelist nodelist = xmldoc.selectnodes("//name"); foreach (xmlnode xmlnode in nodelist) { if (xmlnode["user"] != null) { usertxt = xmlnode["user"].innertext; } else { } return usertxt; } return usertxt; } after calling load contents of xml element in winform display user manipulate. other forms call other elements. ex math.cs call <start> <end> or <ticks> use in other di

c# - initialization of two variables at the same time -

is there way initialize these 2 variable @ same time? in example "time" variable can "" or has value. var variable1 = string.isnullorempty(time) ? string.empty : "value"; var variable2 = string.isnullorempty(time) ? "value" : string.empty; not possible. can create helper class hold 2 variables. or can use out-of-the-box, tuple : var variable = string.isnullorempty(time) ? tuple.create(string.empty, "value") : tuple.create("value", string.empty); and access 2 values variable.item1 , variable.item2 . note: use wisely variables in general better because have names , , hence - meaning . many tuples item1 , item2 can fast become unclear, intended for.

Call a Web Service WSDL with VB.NET -

please can me before go stir crazy in trying figure out. sql dba has self taught myself vb.net interact sql databases have in-house data input etc. i have web service trying build 'loader' provided java based 1 company in question gave cannot deal multiple files , can deal 1 file @ time. https://openinterchange.openecommerce.co.uk/openinterchange/openinterchange?wsdl this url of wsdl. have automation software has inbuilt webservice/wcf executer, while great @ , job doesn't work .net having myself manually. essentially need fire xml using particular function above wsdl return response application. now according automation program uses 'openinterchange' class , uses openinterchange.xstreammessage(x,x,x,x,1) method return information. i ended along lines of dim myservice new xstreamuat.xstreammessagerequest(brokreftxtbx.text, bnumtxtbx.text, lickeytxtbx.text, "this", 30) dim myresult new xstreamuat.xstreammessageresponse(myservice.t

android - how to use GCM in openshift node server -

i new openshift, gcm , node.js. want use gcm service in node server hosted on openshift. want create api key use gcm. crate new key google ask ip address of server. think openshift has not provide static ip cartridges(node, php, java, etc..). how can static ip create key? or there way create api key without giving static ip?. please me.. there´s ready use cartridge called aerogear http://aerogear.org/ if search in openshift, can install , use out of box. it kind-of isolates gcm or whatever push system behind that. i´m still missing features thoug...

Spring social - Facebook cant authenticate -

i trying implement spring social signin facebook or other social network. i doing wrong, dont know it. when request facebook in log see 200 (ok) cant logged user. i logs see: first see facebook returning user: 2014-11-19t14:18:48.156+0100|info: http-outgoing-1 << "{"id":"***","first_name":"***","gender":"male","last_name":"***","link":"https:\/\/www.facebook.com\/app_scoped_user_id\/***\/","locale":"es_es","name":"***","timezone":2,"updated_time":"2014-03-20t21:50:00+0000","verified":true}" but after request see: 2014-11-19t14:18:48.164+0100|info: request "https://graph.facebook.com/me" resulted in 200 (ok) 2014-11-19t14:18:48.165+0100|info: reading [class org.springframework.social.facebook.api.facebookprofile] "application/json" using [org.springframewo

php - How to create summary of data with the ID the data would insert with -

i've mysql function generate identifier-id given table. table have composite key; id - auto_increment act_id - bigint(16). id obtained function below. this function returns bigint(16) begin declare qid integer; select max(id)+1 qid wi_activity; if(qid null) set qid=1; end if; return convert(concat(6,date_format(curdate(),'%d%m%y'),lpad(qid,7,'0')), unsigned integer); end problem 1: the website has multiple data-entry user enter data in given table. there might case when multiple user tries enter data simultaneously. read same value of id generate same value of act_id. problem 2: before inserting table, required display data entered including act_id key acquire after insert , must prevent duplicate act_id key generation. how can these problem solved? you cannot reliably predict id value record going have, except inserting database. the best way insert empty (or full, sort of status attached) rows database, , display ids in page.

string - Need a Concatanate By Group Aggregate Command For Pervasive SQL -

suppose have table this: job_number | part -----------+------------ job 1 | part job 2 | part b job 2 | part c job 4 | part d job 3 | part e in pervasive database need run command give me output: job_number | part -----------+-------------------- job 1 | part job 2 | part b, part c job 4 | part d job 3 | part e sql pseudo code select job_number, concatenate_group_by(part) part job_number_table group job_number i have found post on stackoverflow.com people handling type of thing in orcal , mysql, sql amateur , need here. links reference: concatenate many rows single text string? concatenate , group multiple rows in oracle

C# query List<Tuple> using LINQ -

i have list , need start reading when item1 great myvariable. can using loop , if statement can me using linq? var listdate = new list<tuple<datetime, double>>(); foreach (var item in listdate) { if (item.item1 > myvariable) console.writeline(item); } the linq counterpart of if where : ienumerable<tuple<datetime, double>> query = listdate.where(t => t.item1 > myvariable); you can use foreach -loop or method tolist consume query.

php - Change link target when clicked -

i'm looping through database in while loop, displaying data this: while($data = mysqli_fetch_array($mysql)) { <a href='" . $data['link'] . "'; } what link target change when link clicked to <a href='/links.php?id=" . $data['id'] . "'; so if copy link location http://google.com if click link on site links.php?id=1 hope has idea :) if said (there's nothing malicious) $('a').on('click', function(){ var url = $(this).attr('href'); $(this).attr('href','/links.php?id='+ url); });

java - UnsupportedOperationException JSF - webLogic 11g -

i'm developing web application , i'm using following versions: spring-core 3.1.3 spring-webmvc 3.1.3 spring-webflow 2.3.1 spring-faces 2.3.1 jsf-api 2.0.9 jsf-impl 2.0.9 java 1.6 the application deployed in weblogic server 10.3.6. randomly , exception shown below thrown while navigating through application. java.lang.unsupportedoperationexception @ javax.faces.context.facescontext.getpartialviewcontext(facescontext.java:165) @ org.springframework.faces.webflow.jsfajaxhandler.isajaxrequestinternal(jsfajaxhandler.java:55) @ org.springframework.js.ajax.abstractajaxhandler.isajaxrequest(abstractajaxhandler.java:19) @ org.springframework.webflow.mvc.servlet.flowhandleradapter.createservletexternalcontext(flowhandleradapter.java:216) @ org.springframework.webflow.mvc.servlet.flowhandleradapter.handle(flowhandleradapter.java:192) @ org.springframework.faces.webflow.jsfflowhandleradapter.handle(jsfflowhandleradapter.java:48) @ org.springfr

functional programming - Dealing with database reads in Clojure -

i trying 'purify' of clojure functions. point side-effecting code explicitly declared in 1 function. it's easy data @ start , write db @ end , have pure function transforming in between. however, usual situation transformation function requires db read somewhere in middle of logic: (defn transform-users [users] (let [ids (map :id users) profiles (db/read :profiles ids)] (profiles->something profiles))) (->> (db/read :users) (transform-users) (db/write :something) obviously simple example point is, how side-effecting db/read function out of there, how can make transform-users pure (and benefit, testable)? one thing here dependency-injection-like approach of supplying (potentially) side-effectful function optional parameter, e.g.: (defn transform-users [users & {:keys [ids->profiles] :or {ids->profiles #(db/read :profiles %)}] (let [ids (map :id users) profiles (ids-&g

sapui5 - sap.ui.getCore().byId() returns no element -

i have problem created new sapui5 app , want use sap.ui.getcore().byid(id) access existing controls. in same controller/view can access them via this.byid(id), access controls in other files (e.g. controllers) need sap.ui.getcore().byid(id). however, while sap.ui.getcore() returns core object, cannot access controls via byid() funtion of (returns "undefined"). is there have configure work? i built app sapui5 , there have no issue function call. has idea? thanks! if view's byid-method, can see prepends views id, calls sap.ui.getcore().byid(this.createid(id)). this can instantiate view several times without having duplicate ids. in order access controls outside, either need view can call view.byid(id), or have manually concatenate view's id id this: sap.ui.getcore().byid(viewid + "--" + id).

javascript - <video> playback performance on huge files -

i'm working on webapp run on specific system build. app run in fullscreen / kiosk-mode mozilla firefox / google chrome , 1 of features in app popup video <video> when app 30 seconds inactive. display consists of 3 hd tv's fullscreen browser span (with bezel) makes 5892 x 1080 big. when running video (5892 x 1080) in vlc video runs dream. though when running on google chrome or mozilla firefox, becomes sluggish video. are there settings might adjust on system make render quick vlc?

ruby - Hiding a method from YARD (the right way) -

i using yard document 1 of ruby projects. have methods not want included in documentation, things #inspect , #to_s expect exist , return reasonable result. it possible hide these methods using @private tag , yardoc --no-private command-line option: # @private let's not document def inspect; ...; end however, yard documentation on @private explicitly states: note: method not recommended hiding undocumented or “unimportant” methods. tag should used mark objects private when ruby visibility rules cannot so. if use @api private instead, yard (nicely) tags methods private badge in documentation, still shows them. is there "legal" way hide methods yard output? from limited tests, noticed following works (and doesn't have explicit note in documentation avoid use case): # @!visibility private def inspect; ...; end according yard documentation : @!visibility public | protected | private modifies current parsing visibility (

How do I select tables in a SQL Server that have a field Shape that is an INT type? -

i've got tables shape geometry, , int. want find int type shape fields , fix them. i'm bit of dummy t-sql. you can use information_schema.columns find columns (fields) have data type of int , name of shape. example: select table_name, column_name, data_type information_schema.columns (data_type = 'int') , (column_name '%shape%')

stringbuilder - Increase the size of a string in c# -

i trying write method replaces blank space in %20 in c#. using stringbuilder build new string. running out of range exception, because size of array runs out. there way increase size of string build using string static void main(string[] args) { string add = "mr john smtih"; console.writeline(add); stringbuilder sb = new stringbuilder(add); int j = 0; (int = 0; < add.length; i++) { if (add[i].equals(' ')) { sb[j] = '%'; j++; sb[j] = '2'; j++; sb[j] = '0'; } else { sb[j] = add[i]; } j++; } console.writeline(add); console.writeline(sb); console.readline(); } the string class immutable, once initialize cannot change size of it. you should use append() method in stringbuilder . code this: static void main(string[] args) { string add = "mr john sm

xcode - Not able to assign custom viewcontroller in storyboard -

i absolutely clueless happened xcode. i'm not able assign custom viewcontroller storyboard viewcontroller. error: "unknown class vctest in interface builder file........... class not key value coding-compliant key label" vctest custom viewcontroller. saw several solutions in other posts problem seems lot different. in test app, have 1 viewcontroller: import foundation import uikit class vctest: uiviewcontroller { @iboutlet weak var label: uilabel! } the viewcontroller in storyboard assigned viewcontroller, having 1 label outlet. vctest show under: build phases -> compile sources. must totally missing here or xcode absolutely broken. tried uninstall , reinstall xcode did not help.... have other ungoing project discovered issue , comes in simple test app. going on here? note: happened after upgranding yosmite 10.10 10.10.1. edit: found out til now: somehow created 1 project not happen, on other projects does. did not specify special in working p

java - Spring Security UserDetails cache -

i trying cache userdetails in spring security our rest api. there plenty examples using ehcachebasedusercache few springcachebasedusercache. springcachebasedusercache seems new( after 3.1 spring security?). difference between springcachebasedusercache , ehcachebasedusercache? when should choose 1 on other? lot. ehcachebasedusercache uses, name implies, used ehcache library actual caching. springcachebasedusercache uses spring's own caching abstraction. can example plugin jcache, a.k.a. jsr-107. reason find fewer examples of is newer, jsr-107 did not reach final release until 18 mar, 2014 . note jsr-107 api, not actual implementation. how choose? ehcache mature , well-tested. jcache has future jsr standards process.

ios - Animate titleView on button click -

i'm new animation in ios , i'm trying apply animation on titleview in navigationbar following code keep saying: cannot invoke 'animatewithduration' argument list of type '(floatliteralconvertible, delay: floatliteralconvertible, options: uiviewanimationoptions, animations: () -> () -> $t4, completion: (($t16) -> ($t16) -> $t15) -> (($t16) -> $t15) -> $t15)' when remove self.navigationitem.titleview?.center = cgpointmake(10, 10) there no error, how can apply animaiton on titleview/title? @ibaction func animatebuttontapped(sender: uibarbuttonitem) { uiview.animatewithduration(0.7, delay: 1.0, options: uiviewanimationoptions.curveeaseout, animations: { self.navigationitem.titleview?.center = cgpointmake(10, 10) }, completion: { finished in println("basket doors opened!") }) } uiview.animatewithduration(0.7, delay: 1.0, options:.curveeaseout, animations: { // optiona

Getting Middle Initial from LDAP -

i trying trying middle initial of user ldap. don't know pass directorysearcher. here have far search.propertiestoload.add("memberof"); search.propertiestoload.add("distinguishedname"); search.propertiestoload.add("name"); search.propertiestoload.add("usnchanged"); enter code here search.propertiestoload.add("objectguid"); search.propertiestoload.add("givenname"); search.propertiestoload.add("sn"); search.propertiestoload.add("mail"); search.propertiestoload.add("samaccountname"); there "initials" attribute in user object. u want? http://msdn.microsoft.com/en-us/library/ms676202%28v=vs.85%29.aspx

reverse engineering - How to inspect the UI of native iOS apps? -

how can inspect ui of ios 8 messages token field? jailbreak + flex . it's magical combination.

python - How to escape double brackets in Hyde markdown syntax -

when using hyde static webpage generator have python code double brackets {% syntax %} var[["some-string"]] = foo {% endsyntax %} this renders oddly because [["foo"]] special hyde markdown. normal escaping (e.g. through use of html escape characters ) fails because we're inside of syntax block. how 1 escape characters within hyde syntax block?