Posts

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...

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"...