Posts

Showing posts from February, 2011

Using a SQL server 2008R2 mdf file with SQL Server 2012 -

i'm using sql server 2012 on local machine. have old version of vs solution uses sql server 2008r2 file. old version of solution run on sql server 2012 or have install sql server 2008r2 again? thanks. you can backup database sql server 2008r2 , restore in new version (sql server 2012). sql server upgrade database automatically older version new version. compatibility level of database not changed. can change compatibility of database after restore following query : alter database yourdatabasename set compatibility_level = 110 also, if detach database , attached in new version of sql server, database upgraded new version too.

Laravel migration change and make column nullable -

i created migration user_id unsigned. how can edit user_id in new migation make nullable() ? schema::create('throttle', function(blueprint $table) { $table->increments('id'); $table->integer('user_id')->unsigned(); // needs nullable, how should next migration be? } i assume you're trying edit column have added data on, dropping column , adding again nullable column not possible without losing data. we'll alter existing column. however, laravel's schema builder not support modifying columns other renaming column. need run raw queries them, this: function up() { db::statement('alter table `throttle` modify `user_id` integer unsigned null;'); } and make sure can still rollback migration, we'll down() well. function down() { db::statement('alter table `throttle` modify `user_id` integer unsigned not null;'); } one note since converting between nullable , not null

php - Symfony2: store and retrieve array in session -

i new symfony2 & using symfony 2.5. following official symfony documentation guidance on session. store , retrive array session, following this official documentation . problem background when user logs in , enters website front page, start new session, , store information using following code. $sessiondata = array( 'unit' => $unit, 'client' => $client, 'group' => $group, ); $session = new session(); $session->set('fw', $sessiondata); when print_r session info, gives me following output, expected. array ( [fw] => array ( [unit] => shoes [client] => nike [group] => north ) ) problem 1 now when want add further data array, follow same symfony documentation given here http://symfony.com/doc/current/components/http_foundation/sessions.html#attributes

c - Cropping Square Video using FFmpeg -

updated so trying decode mp4 file, crop video square, , re encode out mp4 file. current code there few issues it. one video doesn't keep rotation after video has been re encoded second frames outputted in fast video file not same length original third there no sound lastly , importantly need avfilter frame cropping or can done per frame resize of frame , encoded out. const char *inputpath = "test.mp4"; const char *outpath = "cropped.mp4"; const char *outfiletype = "mp4"; static avframe *oframe = null; static avfiltergraph *filtergraph = null; static avfiltercontext *crop_ctx = null; static avfiltercontext *buffersink_ctx = null; static avfiltercontext *buffer_ctx = null; int err; int crop_video(int width, int height) { av_register_all(); avcodec_register_all(); avfilter_register_all(); avformatcontext *inctx = null; // open input file err = avformat_open_input(&inctx, inputpath, null, null); if (err < 0) { printf(&

ruby - Rhomobile 4.1.1 - How to create local (non-sync) table -

following documentation trying create first model in rhomobile 4.1.1 it advised create ruby class, , said framework create necessary table. must have misunderstood because not working way. model in app/auth/auth.rb class auth include rhom::fixedschema set :schema_version, '0.1' property :session_token, :string property :remember_token, :string def self.auth_record @auth_record ||= begin if find(:count) == 0 create else find :first end end end end as can see trying create fixed schema single record table. not using rhosync. result there no table created, missing step. hint appreciated. my mistake have require 'auth/auth' on top of 1 of files. the framework relies on const_missing load , initialize model (inject dependencies, create tables, ...). explicitly required source file, constant defined therefore rhodes internal did not perform needed initialization. removing require fixed prob

jquery - autoscroll is skipping menu items -

i'm using bootstrap 3, autoscroll plugin. autoscroll skipping on menu items, , selecting wrong 1 @ wrong time. i.e. scroll section 3 , section 2 highlighted on menu. here's code: html <div class="navbar navbar-fixed-top alt" data-spy="affix" data-offset-top="1000"> <div class="container"> <div class="navbar-header"> <a class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> </div> <div class="navbar-collapse collapse" id="navbar"> <ul class="nav navbar-nav"> <li><a href="#sec0">home</a></li> <li><a href="#sec1&quo

html - Alignment troubles in CSS -

i know website looks pretty crappy. it's work in progress! have no prior html or css experience. the specific part struggling right how name in site header not aligned links , images. have tried multiple solutions regarding alignment (setting line-height, vertical-align, etc.) nothing working. don't see why starting far header/top of page. here relevant css: .header { margin: 0; background: #1c1c1c; text-align: left; position: absolute; top: 0; left: 0; width: 100%; height: 60px; padding: 0; background: #101010; } .header h1 { display: inline; color: #ffffff; } .header ul { display: inline; } .header ul li { display: inline; } .header ul li a:hover { opacity: 0.5; background: none; } .header ul li { display: inline; padding: 0 0.2em; opacity: 0.25; } .header ul li a:hover { opacity: 1; } .header p { background: #1c1c1c; } here relevant html: <div class="header"

android - GridView elements randomly repositioned after scrolling -

so, i'm having weird problem gridview on app. what want pretty simple: want list of installed apps (a-la app drawer) , display them in alphabetical order in gridview. it works pretty well, show nicely, scroll down see more apps , scroll up, apps @ top offselt. vertically, more exact, , happens every time scroll down more 1-2 rows , scroll way up. also, i'll scroll top , it'll keep scrolling past top apps oblivion, , not let me scroll down. i'm not sure if problems related, i'd sure fix both of them. gridview resets normal after clicking on 1 of items or switching windows in app. this 2nd day working android layouts , such, although i've done java programming long time before, might missing i'm not new this. i've looked online , can't quite find answer works, i've tried ones i've found , i'm coming accross solutions have implemented in code, i'm not sure go besides here. i'm not sure part of code post figure out pro

ruby on rails - Errors when running rspec with guard and growl -

i'm high school student new ruby on rails , trying develop rails 4 application tdd. using guard along rspec, spork, , growl notifications, when run guard run tests, following output , no results tests: 11 clairehuang:mezzo$ guard 18:23:31 - info - guard using growlnotify send notifications. 18:23:31 - info - guard using terminaltitle send notifications. 18:23:31 - info - starting spork rspec using rspec, unknown loading spork.prefork block... spork ready , listening on 8989! 18:23:33 - info - spork server rspec started 18:23:33 - info - livereload waiting browser connect. 18:23:33 - info - guard::rspec running 18:23:33 - info - running specs /users/clairehuang/.rvm/gems/ruby-1.9.3-p448/gems/growl_notify-0.0.3/lib/growl_notify.rb:53: warning: instance variable @icon not initialized 18:23:34 - info - guard watching @ '/users/clairehuang/sites/mezzo' /users/clairehuang/.rvm/gems/ruby-1.9.3-p448/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:76: warning: global variable `

c# - How to disable button and then enable it after textbox.textchanged event? -

i have user control acts form updating student records. user control used in page called students update. after update sucessfull, want disable update button. after that, if user changes text, update button should enabled back. trying not working. have textboxes autopost property true. able disable, not able enable again if user starts entering new text in text box. using textbox.textchanged event achieve this. a jquery approach : <body> <form id="form1" runat="server"> <div> <asp:textbox id="textbox1" runat="server"></asp:textbox> <asp:button id="button1" runat="server" text="button" enabled="false" /> </div> </form> <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js" type="text/javascript"></script> <script type="text/javascript">

ios - 'linker command failed with exit code 1' error appear again after xcode restarting -

Image
there many questions 'linker command failed exit code 1 (use -v see invocation)' error. i have solved few times. removing 'library search path', delete , add again libraries(admob, flurry). after works fine. however, key point of problem error occurs again if restart xcode. solve again , job. on next day, error occurs again... the condition xcode 5.1.1 & osx 10.9.3 & ios 6.1 7.1 simulator problem resolved 'copy items destination group's folder (if needed)' option checking. i have thought framework , libraries don't need copy option, , worked before. in time, doesn't.

audio - How to read and play realtime sound stream in java? -

i'm using java read , play real time audio streams such voice radio station. i have real time web address this one , can played in web browser. how can play using java language? thanks. mp3spi java service provider interface adds mp3 (mpeg 1/2/2.5 layer 1/2/3) audio format support java platform. supports streaming, id3v2 frames, equalizer etc. based on jlayer , tritonus java libraries. you can use library mp3 spi java sound , , documentation here . library reference

IOS how to listen on Power button event -

i'm trying make small tool in ios require password while trying shutdown(press power button) machine. but can't find reference listen on powerbutton check whether machine going shutdown.. can advise? thanks, patrick

javascript - JQuery with file upload works in development but not production -

i want implement multi-file upload via jquery , have tried jquery file upload , dropzone. both work fine in development fail in production reason. here jquery code: $(document).on("ready page:load", function() { // drop zone if($('#dropzone').length) { $("#dropzone").dropzone({ maxfilesize: 1.5, paramname: "picture[image]", addremovelinks: true, acceptedfiles: 'image/*,.psd' });} }); here form load images: <%= form_for(picture.new, html: { multipart: true, class: "dropzone", :id=>"dropzone" }) |f| %> <%= f.hidden_field(:activity_id, :value => @activity.id) %> <% end %> this works fine in development in production, following error: [error] typeerror: 'undefined' not function (evaluating '$("#dropzone").dropzone i similar error message jquery file upload. can this? have precompiled assets.

ios - App not getting target url when opened through deep linking -

i have ios app opened via deep linking facebook app when user clicks on story. story has link file. when app delegate's application:openurl:sourceapplication:annotation: called, url fb<appid>://authorize/ , not contain actual target link. does know what's going on here? according (deprecated) https://developers.facebook.com/docs/ios/app-links , have add link's subdomain "website" platform, , did see if solves problem, didn't. i don't see point of facebook app opening app via deep linking without giving required contextual information.

Samsung devices show extra gap in front of actionbar home button -

looks bug, galaxy s5 , note 2 add space in front of home drawable when setdisplayhomeasupenabled() set false we finished enabling home indicator following: getsupportactionbar().setdisplayhomeasupenabled(true); but hiding inside styles.xml: <item name="android:homeasupindicator">@null</item>

Jackson: Serialize only 10 Properties out of 100 -

jackson default includes public getters. if have hundreds of getters , want serialize few of them, how can achieve this? i don't want use @jsonignore annotation specify others hundred properties. you can use jackson's views or filters select serialization form of object. here example using filter picks properties given names: public class jacksonfilter { @jsonfilter("filter") public static class bean { private final string field1; private final string field12; private final string field10; private final string field100; public bean(string field1, string field12, string field10, string field100) { this.field1 = field1; this.field12 = field12; this.field10 = field10; this.field100 = field100; } public string getfield1() { return field1; } public string getfield12() { return field12; }

c++ - Passing user defined class as template parameter -

i trying implement graph in c++. have defined class edge take node name , weight 2 parameters. , class graph , when tried pass edge template parameter in graph declaration graph<int,edge> g , got error. can't pass class template parameter. new c++ coding, please pardon me stupidity. can suggest correct way it? template<class t1,class t2> class edge{ t1 d_vertex; t2 d_weight; public: edge(t1,t2); t1 vertex(); t2 weight(); }; template<class t1,class t2> edge<t1,t2>::edge(t1 v,t2 w):d_vertex(v),d_weight(w){ } template<class t1,class t2> t1 edge<t1,t2>:: vertex(){ return d_vertex; } template<class t1,class t2> t2 edge<t1,t2>::weight(){ return d_weight; } template<class t,class t2> class graph{ vector<pair<t, list<t2> > > node; }; int main() { graph<int,edge> g; } in instantiation graph<int,edge> g; e

c# - EF6 table-per-type: does is matter if the base class is abstract or not? -

we have imlemented class hierarchy 1 base class , 10 classes directly deriving base class. with of ef6 , table-per-type , save data sqlserver . the queries generated huge, investigating our poco model, , in code examples see baseclass abstract. ours not, wondered if makes difference, ef point of view?

php - How to register a session for variable and how to use that in another pages for maintain a user with username or password -

i want know how register session variable , how use in pages maintaining user username or password . my code follows: login.php <?php session_start(); include('connect.php'); $name = $_post['name']; $password = $_post['password']; $role = $_post['member']; $sql = "select * login_register name = '$name' , password = '$password' , role = '$role'"; $retain = mysql_query($sql, $con); // mysql_num_row counting table row $count=mysql_num_rows($retain); // if result matched $myusername , $mypassword, table row must 1 row if($count == 1){ // register $myusername, $mypassword , redirect file "login_success.php" $_session['name']=$name; //header("location:admin_home.php"); if ( $role == "admin") { header("location:admin_home.php"); } else if ( $role == "member") { header("location:member_home.php"); } } else { echo "wrong username , password &

jquery - How to convert html contents to json using PHP? -

i tried save html contents json formatting... http://jsfiddle.net/usernan/2gwmp/ when clicking on #save button, html contents posted , storing json php. [{ "container": [ { "type": "title", "data": 1, "active": true, "content": "content 1", "description": "description 1", "main": [ { "type": "sub", "content": "content 2", "description": "description 2" }, { "type": "sub", "content": "content 3", "description": null }, { "type": "title",

sql server - Is there any advantage to storing a GUID as a UNIQUEIDENTIFIER? -

my code has default value column in table: [questionuid] uniqueidentifier default (newid()) not null, having uniqueidentifier guess correct way if store varchar(50). make bit simpler when working c# code right getting errors type mismatch. the guid (uniqueidentifier) 128 bit number. can indexed other number types (int/bigint/etc...). storing guid varchar(50) bad decision storing integers in varchar.

com.google.api.services.drive.model.File.getPermissions() returns null -

com.google.api.services.drive.model.file.getpermissions() returns null instead of list of permission resources if file has permissions. same fileid when used in com.google.api.services.drive.drive.permissions.list(string fileid) returns right list of permissions. hoping avoid second api call permissions, calling getpermissions() on retrieved file object. does have clue on why getpermissions() returns null ? i had same problem code: drive.files().list().execute().getitems() it turns out google drive api doesn't, default, information each of files returned. in case, fixed specifying fields wanted: final string fields = "items(id,labels/trashed,owners/emailaddress,permissions(emailaddress,name,role),title)"; drive.files().list().setfields(fields).execute().getitems() i used "fields editor" near bottom of page create fields string.

css - Primefaces: CheckBoxMenu with different colors -

i want show selectitems in <p:selectcheckboxmenu> different color or background, how can this? know this? thanks. <p:selectcheckboxmenu id="testresultfilter" value="#{testrunbean.selectedfilterresult}" filter="true" label="execution status" immediate="true" valuechangelistener="#{testrunbean.handleresultchange}" style="vertical-align:middle;" panelstyle="width:220px;" onchange="executestatusonchange();"> <f:selectitems value="#{testrunbean.validresults}" /> </p:selectcheckboxmenu > yes, little of css. css .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-list-item:nth-child(3) { color: aqua; background: #ff00ff; } .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-list-item:nth-child(2) { color: blue; background: #ffff00; } .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-list-it

java ee - Setting WMQ_MDCTX_SET_IDENTITY_CONTEXT impact the COD message -

i had asked question before : mqdestination overriding accounting token value according response able set mq accounting token. changes have resulted in impact on cod used receive earlier. set reply q , reply q manager follows destination codedestination = session.createqueue("queue://" + replytoqueuemgr + "/" +replytoqueuename); logger.info(":::: codedestination :::"+ codedestination); msg.setjmsreplyto(codedestination); using above used cod correctly on sent queue. after added following line support accounting token ((mqdestination) destination).setmqmdmessagecontext(wmqconstants.wmq_mdctx_set_all_context); after adding above line cod not come. if comment out above line cod starts coming again mean accounting token not set. tried following line ((mqdestination) destination).setmqmdmessagecontext(wmqconstants.wmq_mdctx_set_identity_context); but not getting cod. context seems causing issue. other lines setting mqmdreadenabled , mqmdwrite

c# - Filter a mobile number in a string -

i want catch info webpage using html agility pack. info want use : exp1: 22391021 - 09198606027 - 88345027 exp2: 22252554 - 29458456 - 09365861449 exp3: chiako.com 09123937651 - 88424554 (4 line) and input parameters foreach method. how can catch mobile phone structure ( 09xxxxxxxxx ) ? below examples: 1- 09198606027 2- 09365861449 3- 09123937651 and put parameter(s). my code: public void getinginformarion() { string pageload = "http://rahnama.com/cat/index/id/38093/%d8%a7%d8%b9%d8%b2%d8%a7%d9%85-%d8%af%d8%a7%d9%86%d8%b4%d8%ac%d9%88"; htmlweb hw = new htmlweb(); htmlagilitypack.htmldocument doc = hw.load(pageload); htmlnodecollection nodes1 = doc.documentnode.selectnodes("//p[@style='margin:0;']/span"); foreach (htmlnode node in nodes1) { string name = node.innertext; } } try match string regular expression: var match = regex.match(node.innertext, @"09\d{9}"); if (match.succes

statusbar - android - Bug Status Bar and navigation Bar TRANSPARENT -

i have problem translucent statusbar when opening of app first time. take @ screenshot: http://i1335.photobucket.com/albums/w673/ductruongcntt/screenshot_2014-06-26-14-17-26_zps1e9a56f4.png here xml of style use including translucent status bar: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:cliptopadding="false" android:fitssystemwindows="true" android:orientation="vertical" > <com.viewpagerindicator.pagerslidingtabstrip android:id="@+id/indicatortabhome" android:layout_width="match_parent" android:layout_height="40dp" android:cliptopadding="false" android:fitssystemwindows="true" > </com.viewpagerindicator.pagerslidingtabstrip> <android.support.v4.view.viewpager android:id="@+id/vpmain" android:layout

python - Equation roots: parameter doesn't get simplified -

i using python sympy. i need solve following equation, finding 4 roots (omega unknown): deter= 0.6*omega**4*cos(omega*t)**2 - 229.0*omega**2*cos(omega*t)**2 + 5880.0*cos(omega*t)**2 i tried use solve: eqcarr=solve(deter,omega,exclude=[t]) i output: [-18.8143990830350, -5.26165884593044, 5.26165884593044, 18.8143990830350, 1.5707963267949/t, 4.71238898038469/t] i need first 4 values, , not values t coefficient. expect cos(omega*t)**2 simplified in solve, doesn't happen. according documentation solve not solve of free symbols passed in exclude . 'exclude=[] (default)' don't try solve of free symbols in exclude; if expressions given, free symbols in them extracted automatically. it not meant filter solution. you can solve problem doing this: in [10]: sympy import * in [11]: sympy.abc import omega, t in [12]: deter= 0.6*omega**4*cos(omega*t)**2 - 229.0*omega**2*cos(omega*t)**2 + 5880.0*cos(omega*t)**2 in [13]: eqcarr

sql - Searching Excel Document Columns with Visual Basic and Interop -

i'm struggling problem involves interop , excel. basically, have excel files columns contain "headers" , rows beneath columns have data. example, column age have 12,14,etc underneath it. new interop , i'm trying allow user enter name of column header wish extract data from, if enter "age", it'll find age colum b example , extract data proceeding rows. i've googled extensively , haven't found solid, rather context orientated , being new interop makes little tricky. what i've got far: public sub getexceldata(byval directory string) dim excelappfirstfile excel.application = nothing excelappfirstfile = createobject("excel.application") try excelappfirstfile.workbooks.open(directory) dim excelsheet excel.worksheet = excelappfirstfile.worksheets(1) catch ex exception msgbox("there problem: " + ex.message) end try end sub i know isn't i've gone in circles ranges,e

fonts - How to fallback_fonts.xml work in android? -

i see fallback_fonts.xml declares fonts use in android system don't know how working. can can talk me "how fallback_fonts.xml work in android?" thank you. fallback_fonts.xml list of font names hope easy understand: the name fallback_fonts.xml implies meaning "fallback". when phone (or application) cannot find suitable fonts in system font display website (or text or whatever), phone come looking inside fallback_fonts.xml , find suitable font display (orderly top down),if cannot find suitable font, phone cannot display text, display square each unknown character.

javascript - how to get width of ul on the base of class jquery? -

how can width of <ul> on class name class name unique each <ul> . i don't want select id , rather class can reused, my <ul> html is: <ul id="cat-sec-bar" class="restaurantssubtypedivclass" style="display: block;"> //some code here </ul> i trying this: var divwidth = $(".restaurantssubtypedivclass").width(); //getting 0 what wrong here? other way it? try one: var divwidth = $(".restaurantssubtypedivclass").css('width');

ruby on rails - mysql2 gem is not compatible with mysql 5.6.19 -

this question has answer here: mysql2 gem compiled wrong mysql client library 8 answers i want run rails application on mac osx 10.9.3 , got following error: /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `require': incorrect mysql client library version! gem compiled 5.5.23 client library 5.6.19. (runtimeerror) /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `<top (required)>' /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `require' /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require' /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `each' /users/h

angularjs - How should i pass $scope value to function in haml template -

i using haml templates angular js. while template rendering want create function call on div using ng-click. working fine without parameter when passing parameter function behaving below 2 cases. %div.sitescontainer .wrapper %div.site{"ng-repeat"=>"site in sites",'ng-click'=>"siteblockclick({{site.id}})"} %span {{site.name}} then giving me error syntax error: token 'site.id' unexpected inspect div showing ng-click="siteblockclick(bwn)" means value coming single quotes missing. %div.sitescontainer .wrapper %div.site{"ng-repeat"=>"site in sites",'ng-click'=>"siteblockclick('{{site.id}}')"} %span {{site.name}} if given single quotes printing making call ng-click="siteblockclick('{{site.id}}')" how should concat work me ? i want ng-click="siteblockclick('bwn') after inspect any appreciat

php - CodeIgniter - how to post value from form as NULL instead of 0 -

in database table: tab_companies , column company_phone (big integer) defalut value set null. when fill form , leave phone number field empty code igniter should add null value database, instead having value '0'. public function add_company() { $data = array( 'company_short-name' => $this->input->post('company_short-name'), 'company_full-name' => $this->input->post('company_full-name'), 'company_phone' => $this->input->post('company_phone'), 'company_address' => $this->input->post('company_address'), ); return $this->db->insert('tab_companies', $data); } what doing wrong? you do, set null in case empty, like: $company_phone = $this->input->post('company_phone'); ... 'company_phone' => (!empty($company_phone)) ? $company_phone : nul

c++ - Undefined reference to an assembly function -

an assembly function called c++ program my simple assembly code (1.s) .align 4 .code 32 .globl testfunc .func testfunc: bx lr .endfunc .end c++ code is (1.cpp) #include <stdio.h> #include <stdlib.h> extern "c" { void testfunc(void); } int main() { testfunc(); printf("completed\n"); return 0; } i compiled assembly code using arm-none-linux-gnueabi-as -o 1.o 1.s when c++ code compiled arm-none-linux-gnueabi-g++ -o 1c.o 1.cpp getting error in function main, undefined reference testfunc() why happening declared testfunc() extern ? if compilation argument list in form: arm-none-linux-gnueabi-g++ -o 1c.o 1.cpp it means 1.cpp object file output. i'm not sure going in case go linking too. when in form arm-none-linux-gnueabi-g++ -c 1.cpp it means explicity compilation step on file 1.cpp. without linking , resolving dependecies if there problems linking after use ob

java - Executing the page's JavaScript from Selenium WebDriver -

i'm writing automatic test website, , i'm trying run function exists in site. when open developer tools can see function i'm trying run in page's javascript, when run alert('hello world') code can see in test page. code is: webdriver driver = getdriver(); javascriptexecutor js = (javascriptexecutor) driver; string retval = (string) js.executescript("return thefunction()"); what doing wrong? i using gwt, , before use function need reveal function described in this link under creating javascript libraries gwt section you'll need "publish" function follows: $wnd.publishedfuncname = @pakage.class::realfuctionname(d); d stands double input parameter, fuller list of how refer variables can found here after doing can run function if run console, no window.fuction needed. and also, had change type of retval object, , used tostring function.

php - Transfering local host joomla site to live domain database issue -

i'm transferring localhost joomla site telekom live domain , problem when transferring database. i have created export local host database. dump i'm trying import phpmyadmin provided service provider problem when import comes error internal server error server encountered internal error or misconfiguration , unable complete request. please contact server administrator, < unknown> , inform them of time error occurred, , might have done may have caused error. more information error may available in server error log. i have been stuck days, please me guys ! i'm using wampserver windows it's internal error, , server isn't giving you, or us, information out. best bet contact telekom, , ask them in server logs, can investigate problem. provide them information can, give them relevant information: name of server db hosted (they show in cpanel), name of database you're trying dump data, , if you're willing , able so, provide them sql fil

powershell - Find admin group name -

i need find name of admin group local on windows computer powershell. example, if language french, "administrateurs" if it's english, it's "administrators". i find vbs code solve problem. strcomputer = "." set objwmiservice = getobject("winmgmts:\\" & strcomputer & "\root\cimv2") set colaccounts = objwmiservice.execquery _ ("select * win32_group localaccount = true , sid = 's-1-5-32-544'") each objaccount in colaccounts wscript.echo objaccount.name next i'm starting powershell "translate" in powershell ? try this: gwmi win32_group -filter "localaccount = $true , sid = 's-1-5-32-544'" | select -expand name

android - How to select the image with selected layer on it -

Image
how add layer image when selected normal gallery i.e, 1.when select image(long click on image activate selectable mode) there blue layer on indicates image selected 2.when deselect image again(click on image) appears normal image can please suggest how can achieve

windows phone 8 - Adding image to title of Pivot page and handling touch -

i trying add image next pivot control title , want able touch it. can't , guess it's because pivot handling touches. code: <grid margin="162,22,0,0" verticalalignment="top" horizontalalignment="left" tap="messagesicon_ontap"> <image source="/assets/images/icons/messages_icon.png" x:name="messagesicon" stretch="fill" opacity="1" width="20" height="22" tap="messagesicon_ontap"/> </grid> <phone:pivot x:name="playerpivot" title="title" > <!--pivot item one--> <phone:pivotitem margin="0" x:name="playingpivotitem"> <phone:pivotitem.header> <textblock text="subtitle" /> </phone:pivotitem.header> <grid x:name="co

VBA - Excel: Loop through filter values -

Image
basically got filter on column , want perform per filter result set of actions on resulting data. have macro actions need do, wondering how can loop through values in filtered column. i'll explain simple example. i have following example data: now filter column filter, first select filter value now filtered a, perform actions need on remaining data. how can make macro loop through filter results. first select filter, perform actions, remove filter , select b filter, perform actions, etc. note: amount of filter data variable. tl;dr: how make or while loop can run 1 , checks whether there next filter result or not , selects it.

Running JavaFX applications on Redhat 5 -

from previous question , know javafx not supported in redhat 5.8 meaning, when have java 8 (jdk1.8.0_05) installed on linux, jar file created in win7 can't executed via java -jar helloworld.jar . mean there no way run javafx jars on machine? the problem running javafx applications on rhel5 version of glib comes os not new enough. trick, then, provide newer version of library , of other libraries depend on jre. next hurdle rhel5 shared library loader won't load libraries. have use compatible loader. jvm has path loader hard-coded in executable! need separate jvm custom loader path patched in. roughly, steps working are... unpack following packages rhel 6 : glib2 libffi glibc glibc-common zlib gtk2 pango cairo pixman put of shared libraries packages in directory on rhel5 system. let's call /your-alien-rhel6-libs-path . unpack copy of jre to, say, /your-alien-jvm-path . use patchelf point jvm executable new loader. ./usr/bin/patchelf --set-in

wordpress - Update copyright at bottom of page? -

i looking update copyright date wordpress website current. @ bottom of page lists copyright. told check out footer.php can't find string ' center homicide research © 2012. rights reserved.' cannot edit it. go wp-admin >> go appearance >> editor >>> select functions.php theme functions file than find 2012. reserve. edit , save it.

Using mysql_real_escape_string in a multidimensional array in php -

i working on big script generate string or array or multidimensional array want use mysql_real_escape_string array / string tried below code function check($data) { if(!is_array($data)) { return mysql_real_escape_string($data); } else if (is_array($data)) { $newdata = array(); foreach($data $datakey => $datavalue){ if(!is_array($datavalue)){ $key = mysql_real_escape_string($datakey); $value = mysql_real_escape_string($datavalue); $newdata[$key] = $value; } } return $newdata; } } if use check('saveme'); returns value if pass array returns corrent value [ check(array('a','b','c',1,2,3)) ] if pass multidimensional array [ check(array(array('a',array('a','b','c',1,2,3),'c',1,2,3),'b',array('a','b','c',1,2,3),1,2,3)) ] a kind note want u

Is it possible to declare the type of the variable in Rust for loops? -

c++ example: for (long = 0; < 101; i++) { //... } in rust tried: for i: i64 in 1..100 { // ... } i declare let i: i64 = var before loop i'd rather learn correct way doing this, resulted in error: expected 1 of `@` or `in`, found `:` --> src/main.rs:2:10 | 2 | i: i64 in 1..100 { | ^ expected 1 of `@` or `in` here you can use integer suffix on 1 of literals you've used in range. type inference rest: for in 1i64..101 { println!("{}", i); }

Android Studio 0.8.1: New project and can't preview the L version in the renderer of phones -

i installed api level 20 , 19 after installing 0.8.1 , created brand new project. in renderer (preview) of activity.xml don't see right l version rendered. see api l on drop down selected phone looks halo effect on l. before installing level 20 , 19 did seem work. new project creates following gradle file , there v21 theme.. set <style name="apptheme" parent="android:theme.holo.light.darkactionbar"> before installing 19 , 20 noticed values-v21 directory never creates now. here copy of gradle gets created. have tried playing around these values doesn't work. android { compilesdkversion 20 buildtoolsversion "20.0.0" defaultconfig { applicationid "com.tester.myapplicationtest" minsdkversion 15 targetsdkversion 20 versioncode 1 versionname "1.0" the strange thing before installing api 19 , 20 think working. on new project never asks me sdk or max version mi

Setup application to use Microsoft accounts with hybridauth -

i want set app's redirect url " http://www.mydomain.com/hybridauth/endpoint?hauth.done=live ", in microsoft account developer center tells me that "you must enter valid domain begins http:// or https:// - query strings not allowed. length limited 248 characters." the login button redirects following url https://login.live.com/err.srf?lc=1033#error=invalid_request&error_description=the%20provided%20value%20for%20the%20input%20parameter%20%27redirect_uri%27%20is%20not%20valid.%20the%20expected%20value%20is%20%27https://login.live.com/oauth20_desktop.srf%27%20or%20a%20url%20which%20matches%20the%20redirect%20uri%20registered%20for%20this%20client%20application . any way link url? it seems bug in live provider implementation. you must edit hybridauth/hybrid/providers/live.php file , change line below: $this->api->authorize_url = ' https://oauth.live.com/authorize ';

inject string at %(variable)s in R (Url pattern) -

i tryning build kind of rest full api comunicate r. got issue replacement of strings. i've got url path as: http://localhost:8000/rest/api/model/%(id)s/model_function i need replace "%(id)s" model's id. function python stuff: function(url, list(id=[id_value]) returning... http://localhost:8000/rest/api/model/[id_value]/model_function any tips around? implement string replacement: substitute_url_args <- function(url, list_args){ replace_names <- paste("%(",names(list_args),")s", sep="")<br> <- 1 (i in 1:length(names(list_args))) { url <- sub(replace_names[i], list_args[[i]], url, fixed=true) } return(url) } sure not elegant solution! thanks in advance, andré try gsubfn in gsubfn package: library(gsubfn) substitute_url_args <- function(url, list_args) { gsubfn("%\\((.*?)\\)s", x = url, env = list_args) } # test s <- "http://localhost:8000/rest/api

parallel processing - Parfor sliced variable cause Matlab crash -

i'm trying prove code run in parallel, code works except when i'm assiging data sliced variable, believe i'm respecting matlab's parfor restrictions, , in fact runs smoothly parfor iterations point matlab crashs asking exiting. the problem in last line when asigning values "features" (i've tried cells same problem): if (matlabpool('size')==0) matlabpool(); end %prepare iterations numtrain = size(xnorm(1000:1250,:),1); numfeatures = size(xnorm,2); classdata=y(1000:1250,:); %linear space grid zz = linspace(0.1,20,10); zsize=length(zz); %definitions use inside parfor features=zeros(numfeatures,1); fmax=@(x) max(x); parfor = 1:numfeatures %internal variables definition cscross=zeros(zsize,1); sigmacsmax=zeros(zsize,1); fprintf('\nfeature:%i...',i); j=1:zsize %precompute kernel k = [ (1:numtrain)' , gpukernel(xnorm(1000:1250,i),zz(j)) ]; iter = 1:zsize options = spr

c# - Socket.Shutdown and threads -

i'm pretty new socket programming. our application uses sockets communicate device our company manufactures. have problem socket taking long time close. here's code run when time close socket: if (client != null) { try { if (client.connected) { client.disconnect(false); client.shutdown(socketshutdown.both); } client.close(); } catch (socketexception) { } client = null; } i've read documentation socket.shutdown method , the responses question , i'm confused. data pending transfer remote system system, or vice versa, transferred or abandoned? if data pending transfer abandoned, delaying socket's closure? call shutdown before close can make sure data queued received. do not call disconnect . why necessary? no reason. wrong before shutting down. think whether makes sense or not. call dispose or close after shutdown release os resources. connection reliably closed now.

installing ios app over a link without hitting the 100 limit -

i've been noticing apps able distribute ios apps via web link (he humin app example) - , not seem collect device id testflight/ad-hoc distriubtion. how this? somehow instananeously add device provisioning profile or using other method? they must have purchased enterprise account through can share build without having need add device id provisioning profile. it used enterprise , can shared against terms , conditions/rules. you can find enterprise account details here https://developer.apple.com/programs/ios/enterprise/

c++ - Lowest common ancestor in a linear lineage of types -

Image
intro let's suppose have linear hierarchy of types following: then want a mechanism return lowest common ancestor out of arbitrary number of types in lineage. attempted code template<typename...ts> struct lca; template<typename t1, typename t2, typename...ts> struct lca<t1, t2, ts...> { using base = typename std::conditional < std::is_base_of<t1, t2>::value, t1, typename std::conditional < std::is_base_of<t2, t1>::value, t2, void >::type >::type; using type = typename lca<base, ts...>::type; }; template<typename t> struct lca<t> { using type = t; }; live demo use case my use case rather typical: in making iterator tools want extract "most restrictive" iterator type, since there's (kind of) linear hierarchy in iterators should able ascent hierarchy as it's needed: lca<bidirectional, randomaccess, randomaccess> -> b