Posts

Showing posts from April, 2015

Display a block in Magento Admin Panel -

i getting error below recoverable error: argument 1 passed mage_adminhtml_controller_action::_addcontent() must instance of mage_core_block_abstract, boolean given, my indexaction code below public function indexaction() { // instantiate grid container $brandblock = $this->getlayout() ->createblock('digitech_brandlogo_adminhtml/brandlogo'); // add grid container item on page $this->loadlayout() ->_addcontent($brandblock) ->renderlayout(); } in case question mean " $brandblock = $this->getlayout() ->createblock('digitech_brandlogo_adminhtml/brandlogo'); " ?? i know block , layout structure/arrangement this. sorry late answer may 1 helps else can use code, please replace "my_block_name_here" , "activecodeline/developer.phtml" block name , template path public function indexaction() { //get current layo...

java - Jackson @JsonManagedReference on collection (one to many) -

i have following 2 classes. school has many testtaker s @entity @table(name = "school") @jsonidentityinfo(generator = objectidgenerators.propertygenerator.class, property = "id") public class school extends basemodel { @column(name = "name") private string name; @onetomany(mappedby = "school") // @jsonmanagedreference <<<<< if not commented out, error private set<testtaker> testtakers; //getter setters } // testtaker.java @entity @table(name = "test_taker") @jsonidentityinfo(generator = objectidgenerators.propertygenerator.class, property = "id") public class testtaker extends basemodel { @column(name = "first_name") private string firstname; @column(name = "last_name") private string lastname; @manytoone @joincolumn(name = "school_id") @jsonbackreference("school_testtaker") private school school; //...

c# - How to make a regex pattern in Razor/MVC3 to exempt certain characters -

i know how write pattern regex in razor/mvc3. have been searching how write pattern since didn't know mvc/razor found regex pattern characters ^[a-za-z]+$ numbers ^[0-9]*$ character , numbers ^\w+$ email address. /\s+@\s+\.\s+/ those patterns found not 1 looking for. create pattern exempt these characters "&';,<> . thought of 1 way doing it. this: ^[a-za-z0-9_!#$%()-=~^|+and on..]*$ do have list characters exempt those? or there more efficient way of doing it? (posted on behalf of op). i have used @"^[^"" & ';,<>]*$" suggested simon in comments, , worked.

ruby on rails - Elasticsearch - undefined method `as_indexed_json' -

i'm able bare bones keyword search no issues in app using elasticsearch, as_indexed_json isn't working apparently , have no idea why. i'm following tutorial , , section in question halfway down. please let me know if need provide additional info. i'm pretty new this, apologize if dumb question. rails console: 2.2.4 :011 > term.first.as_indexed_json term load (0.4ms) select "terms".* "terms" order "terms"."id" asc limit 1 nomethoderror: undefined method `as_indexed_json' #<term:0x007fa6cd9a6408> /users/emplumb/.rvm/gems/ruby-2.2.4/gems/activemodel-4.2.5/lib/active_model/attribute_methods.rb:433:in `method_missing' (irb):11 /users/emplumb/.rvm/gems/ruby-2.2.4/gems/railties-4.2.5/lib/rails/commands/console.rb:110:in `start' /users/emplumb/.rvm/gems/ruby-2.2.4/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in `start' /users/emplumb/.rvm/gems/ruby-2.2.4/gems/railties-4.2.5/lib/rails/commands...

javascript - Would like to hide "|" if elements are not showing in Angular JS -

trying hide <li>|</li> when genres array have no value. use ngif / nghide this, or have code controller? here html: <div> <ul class="list-inline"> <li ng-if="genre.name" ng-repeat="genre in genres"><a ng-href="/#/genre/{{genre.id}}">{{genre.name}}{{$last ? '' : ', '}}</a></li> <li>|</li> <li ng-if="runtime">{{runtime}}min</li> <li>|</li> <li>{{release_date | date}}</li> </ul> </div> any appreciated. all have check have genres in array ngif directive, so: ng-if="genres.length"

Swift - Getter and Setter for Computed Properties as String type -

hello im new swift development no objective-c background, although have strong fundamentals in java, swift has stiff learning curve me, i'll go straight question, ill post code first class vehicle { var gear : string { { return self.gear } set { self.gear = newvalue } } } var vehicle = vehicle() vehicle.gear = "adasd" im having compiler error saying ./run-swift: line 18: 30295 segmentation fault: 11 gtimeout -k $timeout_kill_after $timeout_duration $swift_compiler -target $target -sdk $sdk $optimization_level $input_file -o $output_file i realy dont understand why simple code not compile using string type, if change variable declaration int type , assign value property have no problems @ all. self.gear here calls getter gear calls self.gear . you've created infinite loop. have similar situation setter. don't need implement get , set if want store property. final class ...

c++ - Why is this if statement not running when the values are equal to each other? -

i trying implement code takes morse code 3 spaces between each letter , gets first morse translation , compares array containing morse code translations. goes buffer == morsem[j] , buffer should equal .- , morsem[j] should equal .- ; if j = 0 , both do, not executing if 's block. idea why? #include <iostream> using namespace std; int main(){ char morsem[26][5] = {{".-"},{"-..."},{"-.-."},{"-.."},{"."},{"..-."},{"--."},{"...."},{".."},{".---"},{"-.-"},{".-.."},{"--"},{"-."},{"---"},{".--."},{"--.-"},{".-."},{"..."},{"-"},{"..-"},{"...-"},{".--"},{"-..-"},{"-.--"},{"--.."}}; char alpha[27] = "abcdefghijklmnopqrstuvwxyz"; char morse[] = ".- ...."; int length; int first_cou...

Good hash function over C++ unordered_set -

i'm looking implement hash function on c++ std::unordered_set<char> . tried using boost::hash_range: namespace std { template<> struct hash<unordered_set<char> > size_t operator(const unordered_set<char> &s)( { return boost::hash_range(begin(s), end(s)) }; } but realised because set unordered, iteration order isn't stable, , hash function wrong. better options me? guess std::set instead of std::unordered_set , using ordered set because it's easier hash seems ... wrong. a similar question, albeit in c#, asked here: hash function on list independant of order of items in it over there, per gave nice language-independent answer should put on right track. in short, input x 1 , …, x n you should map to f(x 1 ) op … op f(x n ) where f hash function single elements (integer in case) op commutative operator, such xor or plus hashing integer may seam pointless @ first, goal make 2 neighboring integers dissimil...

PHP: Comparing an array, getting largest value and updating -

i have array that's submitted menu , have take largest value of subcategory , use highest price. updates can occur multiple times user adds more items. user scenario : user clicks on ingredient, another, another. during each addition, prices updated dynamically. one of subcategories salad greens or ingredienttype_id = 1 . current code: $prices = $db->get_ingredient_prices($list); $free_items = $db->get_free_ingredient_types($item); foreach($prices $price){ if(array_key_exists($price['ingredienttype_id'], $free_items)){ $qtya = $free_items[$price['ingredienttype_id']]; $qtyb = $customizations[$price['id']]; if($qtya == 0){ $qtyc = $qtyb; } elseif($qtya > $qtyb){ $free_items[$price['ingredienttype_id']] = $qtya - $qtyb; $qtyc = 0; } elseif($qtya < $qtyb){ $free_items[$price['ingredienttype_id']] = 0; $qtyc = $qtyb -...

jquery - Slowing Down Slideshow Effect on MegaMenu -

i have megamenu working, it's clunky. i'm trying slow down slidedown effect additional jquery (which second section of code see below). far seem grabbing wrong elements though. elements should placing in last section of jquery code in order target drop-menu items, rather whole menu? right whole menu vanishes when clicked, rather individual elements. jquery(document).ready(function(jquery) { var menu = jquery('#mega-menu-wrap-secondary'); // change target menu // not edit below line jquery('li.mega-menu-item', menu).on('open_panel', function(e) { var sub_menu = jquery('.mega-sub-menu', jquery(this)); menu.css('margin-bottom', sub_menu.height()); }); jquery('li.mega-menu-item', menu).on('close_panel', function(e) { menu.css('margin-bottom', ''); }); }); jquery(document).ready(function(){ jquery(".mega-menu").mouseenter( function() { ...

xquery - Numbers in cts:word query in Marklogic -

i have cts:word-query having number text value. cts:search(fn:doc(),cts:word-query("226")) this query fetch results matching 226 in documents. need documents contain 0026 also. example: abc.xml <a> <b>00226</b> </a> this abc1.xml <a> <b>226</b> </a> if give query cts:search(fn:doc(),cts:word-query("226")) , fetch abc1.xml , if query cts:search(fn:doc(),cts:word-query("00226")) , fetch abc.xml. but need both documents, irrespective of leading zeros. simplest way use wild card character ( * ) , add wildcarded option cts:search(fn:doc(),cts:word-query("*226", ('wildcarded'))) edit: although matches example documents, kishan points out in comments, the wildcard matches unwanted documents (e.g. containing "226226"). since range indexes not option in case because data mixed, here alternative hack: cts:search( fn:doc(), cts:word-query( ...

c++ - Symbol in Text section yet undefined -

i have built xerces on hp-ux using c++. builds executables link against libxerces-c-3.1.sl. while running of them getting symbol not found error: shlib_path=../lib ./domcount /usr/lib/dld.sl: unresolved symbol: _znk11xercesc_3_113xmlbigdecimal10getrawdataev (data) /home/build/hp-ux/lib/libxerces-c-3.1.sl [hp aries32]: core file 32-bit pa-risc application [hp aries32]: /home/build/hp-ux/bin/domcount saved /home/build/hp-ux/bin/core.domcount segmentation fault (core dumped) i executed nm command shows symbol undefined. can see xercesc_3_1::xmlbigdecimal::getrawdata() in text section well. nm -pxan libxerces-c-3.1.sl | c++filt | grep getrawdata ../lib/libxerces-c-3.1.sl:0x002c2ac8 t xercesc_3_1::xmlabstractdoublefloat::getrawdata() const ../lib/libxerces-c-3.1.sl:0x002c5390 t xercesc_3_1::xmlbigdecimal::getrawdata() const ../lib/libxerces-c-3.1.sl:0x004818c4 t xercesc_3_1::xmldatetime::getrawdata() const ../lib/libxerces-c-3.1.sl:0x00000000 u xercesc_3_1::xmlbigdecimal::g...

ASP.net like form based authentication in WPF MVVM prism -

having working on wpf mvvm (prism) application, implement authentication asp.net form based authentication. restrict users going screens authorization required. how can implemented in wpf application, using prism. assuming using regions navigate within application, viewmodels can implement iconfirmnavigationrequest interface. there, can use confirmnavigationrequest takes callback, determine if user has access view, , if not, deny it. samples can found here check out this link learn more this

android - Set/Get Extras in Multiple Instances of Notification -

i have android notification sent id destination activity. that, use intent putextra this: intent resultintent = new intent(this.context, confirmationactivity.class); resultintent.putextra("id", idtosent); resultintent.setflags(intent.flag_activity_new_task | intent.flag_activity_clear_task); resultpendingintent = pendingintent.getactivity(this.context, 0, resultintent, pendingintent.flag_update_current); the problem when call notification 2, 3 or more time. when use "getextras" in method oncreate of activity, have same id (the last id sent last notification instance) i had try changing intent's flags, can't find right combination can me this? how have, lets say, 3 instances of notification , when click on notification, sent 3 diferents id activity? this full code: //notification manager class public void sendnearpromotionnotification(int idtosent){ notificationcompat.builder notificationbuilder = new notificationcompat.builder(th...

c# - Failure to bind the ArrayList to DataGrid -

i not sure doing wrong here. want bind arraylist datagrid have on main page. things coming blank or erroring out. samples can give great help. need have put image in 1 column clickable. hardcoded. thanks. in default.aspx page have... <"asp:datagrid id="datagrid1"> <"/asp:datagrid> then in default.cs page have... public class share : page { protected textbox sendextradetails; protected datagrid datagrid1; ...... public void page_load(object sender, eventargs e) { arraylist alist = (arraylist)session["rsarraylist"]; session["rsarraylist"] = alist; datagrid1.datasource = alist; datagrid1.databind(); } } try this: arraylist alist = (arraylist)session["rsarraylist"]; datagrid1.datasource = alist; datagrid1.databind();

javascript - How to read scope properties from parent scope -

i creating simple directive stuck @ beginning. problem unable read property scope in post function. here code: <div mod type="{{subnet.isdynamic | type }}"></div> networkinterfaces.directive('mod', function () { return { scope: { type: '@' }, link: function (scope, ielement, iattrs, controller) { console.log(scope.type); if (scope.type == "static") { ielement.css('background', 'blue'); } if (scope.type == "dynamic") { ielement.css('background', 'green'); } } } }); your scope property wrong , don't need here. a working plnkr here : http://plnkr.co/edit/ezbzad?p=preview please refer docs understand scope property inside directive : http://docs.angularjs.org/guide/directive but if want use : app.directive(...

jquery - Issue targeting div after creating it with .wrap() -

i'm having strange issue checking whether div created .wrap() visible or not. i'm wrapping divs , using id's on them targets. i've tested make sure click registering alert() , , is. here code. //leftbar jquery $('ul.leftnav').wrap('<div id="leftnav-wrap" class="five columns alpha" />'); $('#leftnav-wrap').prepend('<div class="arrow" />'); $('#content').has('#leftnav-wrap').find('#page').wrap('<div class="eleven columns omega" />'); //mobile leftbar $('h4.mobile.toggle').click(function(){ if ($('#leftnav-wrap').is(':hidden')){ $(this).addclass('active'); $('#leftnav-wrap').addclass('active'); } else{ $(this).removeclass('active'); $('#leftnav-wrap').removeclass('active'); } }); is there inherently wrong i've coded? ...

sockets - server unable to retrieve sender port and IP -

setup: 1) laptop connected router in home network. have no-ip domain name. have port-forwarding on router forward port 40000 laptop a. laptop "server" listening on port 40000. 2)i have laptop b connected same router. run "client" on b. creates socket (udp) own port 45000 connects sever (domain name & port 40000) , sending messages. laptop receives. well. 3) when try capture laptop b (sender's) address & port in readmessag(..), gives me ip addressof router (71.xx.yy.zz) , port of 1024. thought give sender ip (whatever 192.x.y.z , port of45000.). how can connect , exchange messages a-->b ? (i hoping can ip of port of client initial message , reply , establish 2 way communication.) disconnect ? -----i using qt toolkit //server code excerpt udpsocket = new qudpsocket(); int retbind=udpsocket->bind(qhostaddress::any,40000); //server reads message client (code checking pending datagrams not shown) udpsocket->readdatagram(datagram.data(...

php - Base URL error in CodeIgniter -

i new in codeigniter. in project, base url code not working properly... in config.php: $config['base_url'] = 'http://localhost/simpleblog/'; in view, is: <link type="text/css" rel="stylesheet" href="href="<?=base_url()?>views/css/main.css" /> my project file structure attached in skydrive https://skydrive.live.com/redir?resid=3bff708c7026eb1b!139&authkey=!aeqsh3kwtzdu328&v=3 and error https://skydrive.live.com/redir?resid=3bff708c7026eb1b!140&authkey=!amwgc_uwpqlezom&v=3 how solve issue? the base_url function part of url helper. codeigniter not load helpers default, must load helpers want use. you can either in controller you'll using function: $this->load->helper('url'); or if it's helper intend use throughout site, can tell codeigniter automatically load adding $autoload['helper'] array in config/autoload.php. btw - use case, recommend sit...

Remodel data and transforamtion in Cassandra -

1)i fetch data third party oracle database , load temporary tables in database 2) transformation using ssis etl - have static tables referred 3) ssis loads data final database used adhoc business queries. now remodel in cassandra 1) third party database remain 2) can directly load temporary tables in cassandra, how can transformation , joins static tables cassandra data model specific. if wrong modeling, you're screwed. before dumping every cassandra, should first analyze requirements determine read & write path. about joins forget it, nothing such join exists in cassandra. key de-normalization

How to convert Spring MVC to android project using PhoneGap? -

i didn't find tutorial in internet can shed light on creating android project spring mvc project using phone gap. i started sample mvc application , need create android client out of it. can me it. rest services transferring data on http, can use json or xml ajax call rest services in phonegap app , server side spring mvc. sure following link can http://www.javacodegeeks.com/2013/04/spring-mvc-easy-rest-based-json-services-with-responsebody.html

javascript - Trouble with RequireJS optimizer config, bbb release -

i'm using requirejs, backbone boilerplate layout manager, jamjs manage packages, , works fine in development, when try create production version concatenated files doesn't work. it looks shim in config might not getting loaded. example, error in console uncaught typeerror: cannot set property 'cookie' of undefined , jquery not getting loaded dependency jquery.cookie. here's app config: // set require.js configuration application. require.config({ // initialize application main application file , jamjs // generated configuration file. deps: ["../vendor/jam/require.config", "main"], paths: { baseurl : '/', config : "config", // javascript folders. api : "libs/api", app : "app", // libraries. almond : "../vendor/jam/js/libs/almond", engagement : "libs/engagement", environment : "libs/environment", jquery : "../vendor...

c# - Is it possible to write completely maintainable code? -

Image
i downloaded "microsoft codelens code health indicator" vs 2013 extension ( http://visualstudiogallery.msdn.microsoft.com/f85a7ab9-b4c2-436c-a6e5-0f06e0bac16d ) ...and opened simple utility. score of methods ran low of 52 high of 92. the microsoft-written method 1 higher score. 1 reference | maintainability 94 public form1() { initializecomponent(); } commenting out "initializecomponent();" raised maintainability max (100), of course, in case @ least, ultimate in maintainability negative ultimate in usability. is there way score of 100 on useful code? update here's code ranked 100% maintainable: according microsoft's dev network, maintainability reading rated on scale of: 20-100 - maintainable 10-20 - "warning zone" 0-10 - unmaintainable code having code within 90's code, believe if @ 100 aren't working anything. as far "can have usable code" 100, no initially, suppose possible useful exi...

ios - UIBarButtonItem tint not working in 6.1 app on iOS7 device -

Image
i have view controller adds button navigation bar orange tint color. uibarbuttonitem *bt = [[uibarbuttonitem alloc] initwithtitle:@"call us" style:uibarbuttonitemstyleplain target:self action:@selector(calluspressed:)]; bt.tintcolor = [uicolor colorwithred:(247/255.0) green:(151/255.0) blue:(48/255.0) alpha:1.0]; self.navigationitem.rightbarbuttonitem = bt; this works fine in ios6.1 device. is, button shows orange. in ios7 device, button first shows blue. when tap on it, button becomes orange. the app compiled against ios 6.1 sdk. bug in ios7 or doing wrong. this appears bug in ios 7's handling of ios 6.1 ui elements. i've tried number of ways , cannot reliably set uibarbuttonitem tint color. setting color after added navigation item in viewdidload works first screen not later screens. can in viewdidappear: end blue during animation. your best bet set tint color on navigation bar itself, , if need bar diffe...

c++ - Returning Image Pointer to Erlang -

i trying use opencv erlang nif. want basic thing , that's read picture , send pointer erlang. , able again send pointer received c , show pic so niftest.cpp this: /* niftest.cpp */ #include "erl_nif.h" #include <opencv/highgui.h> #include <opencv/cv.h> using namespace cv; using namespace std; static erlnifresourcetype* frame_res = null; typedef struct _frame_t { iplimage* _frame; } frame_t; //------------------------------------------------------------------------------ // nif callbacks //------------------------------------------------------------------------------ static void frame_cleanup(erlnifenv* env, void* arg) { enif_free(arg); } static int load(erlnifenv* env, void** priv, erl_nif_term load_info) { erlnifresourceflags flags = (erlnifresourceflags) (erl_nif_rt_create | erl_nif_rt_takeover); frame_res = enif_open_resource_type(env, "niftest", "ocv_frame", &frame_cleanup, ...

node.js - Restify: Retrieve external url content (ISO-8859-1) return to requesting client (UTF-8) -

i have simple javascript using node. purpose of script to: open listening socket add handler url /test http function get when /test requested url located on external web site should fetched. web site encoded iso-8859-1 the data returned external website should packaged in json structure , returned requesting client encoded utf-8 so far have created following code: var buffer = require('buffer').buffer; var iconv = require('iconv-lite'); var urllib = require('url'); var restify = require('restify'); var server = restify.createserver(); server.use(restify.bodyparser()); server.get('/test', test); server.listen(8080, function() { console.log('%s listening @ %s', server.name, server.url); }); function test(req, res, next) { console.log('test'); var httpclient = restify.createstringclient({ url: "http://dl.dropboxusercontent.com" }); httpclient.get("/u/815962/iso-8859-1.html", functi...

cuda - Shared memory address passed to device function is still shared memory? -

let's have __device__ function: __device__ unsigned char* dev_kernel(unsigned char* array_sh, int params){ return array_sh + params; } and within __global__ kernel use in way: uarray = dev_kernel (uarray, params); where uarray array located in shared memory. but when use cuda-gdb see addresss of uarray within __global__ kernel get: (@generic unsigned char * @shared) 0x1000010 "z\377*" and within __device__ kernel get: (unsigned char * @generic) 0x1000010 <error reading address 0x1000010: operation not permitted> despite error, program in running ok (maybe limitation of cuda-gdb). so, want know: within __device__ kernel, uarray shared yet? i'm changing array global shared memory , time same (with shared memory time little worse). so, want know: within __device__ kernel, uarray shared yet? yes, when pass pointer shared memory device function way, still points same place in shared memory. in response questions ...

networking - Is there an advertising network for firefox OS -

does know of advertising network supports firefox os. know adsense work because html im not sure if allowed rules etc. allowed on hosted apps because websites? here's post on mozilla hacks blog talks 1 ad monetization option firefox os: https://hacks.mozilla.org/2013/10/monetization-with-inneractive-on-firefox-os/

Scala delegate within multi-argument method call -

assume there functional delegate method called "delegatedfoo()" needs passed argument method (ie, scala's version of function pointer) so: addmydelegatedmethod(delegatedfoo) assume (for brevity), line compiles/executes fine. change this: addmydelegateoverridemethod("uh-o", delegatedfoo) this line throw compiler exception: missing arguments method delegatedfoo in class myclass q: how 1 go passing delegate (reference) within multi-argument method call? (is can done in scala?) edit: more precise, signatures follows: def delegatedfoo(str: string): string = { return "ok" } def addmydelegatedmethod(delegate: (string) => (string)) def addmydelegateoverridemethod(foo: string, delegate: (string) => (string)) update : after reviewing paolo's answer , doing more experimenting, best can tell issue (bug?) surfaces when there overloaded signature involved. (i didn't bother throwing example above, wasn't used -- having there app...

android - How to make an app or specific activity launched when pressing menu button or power button etc (e.g like 3 times)? -

how make activity in specific app(security app) started when pressing (menu or other of device buttons), should do?, i'm have broadcastreceiver in app(to read sms). i'm new android, should start? please me. edit: in phone(samsung) if press long on menu button 1 of google apps started(launched). according official android documentation ( http://developer.android.com/reference/android/view/keyevent.html#keycode_home ): key code constant: home key. key handled framework , never delivered applications.

graphics - How to do phong shading in POV-ray -

i using pov-ray raytracer rendering. have mesh of triangles, when render using : mesh { triangle { < corner_1>, <corner_2>, <corner_3> } } i not getting smooth shading, there provision smooth shading in pov-ray using : smooth_triangle { <corner_1>, <normal_1>, <corner_2>, <normal_2>, <corner_3>, <normal_3> [object_modifier...] } but problem requires normal of corners of triangle ( uses phong shading ), how calculate normal @ corners of triangle? how have smooth shading in pov-ray? note: triangles sharing common vertices have same normal @ vertices

c# - GridView in asp.net not accepting click -

i have issue, 1 of simple basics, not know behavior. have simple gridview displaying on asp.net page using vs 2010. page loads fine , can see grid when try click on it, nothing happens. it's clicking on empty space. trying send row data textbox. fyi: 1) gridview being filled out dataadapter , own dataset. 2) onselectedindexchanged event has been set up. 3) every field bound specific field db. gridview code: <asp:gridview runat="server" width="300px" height="100px" id="mstpx_grdctrl" autogeneratecolumns="false" onselectedindexchanged="mstpx_grdctrl_selectedindexchanged" > <columns> <asp:boundfield datafield="codpx" headertext="código" /> <asp:boundfield datafield="nombre" headertext="nombre" /> <asp:boundfield datafield="apellido" headertext="apellido" /> </columns> <...

android - How to toggle SYSTEM_UI_FLAG_HIDE_NAVIGATION after interaction? -

i using system_ui_flag_hide_navigation flag in activity hide system bar (i'm working on "kiosk" style application) it works well, kind of interaction makes re-appear, documentation states. what best way re-enable flag after interaction? could point me in direction on how implement "auto-toggle"? nb - not want (in fact cant, proejct) use 3rd party applications achieve feature. you should add "system_ui_flag_immersive_sticky" option keep hiding. https://developer.android.com/training/system-ui/immersive.html

php - Symfony2, one-to-many relation, creating new task with automatic new category -

i'm trying create new task , task assign pre-created categories. problem is, after submit form, automatically create new category same name, selected in category list, , symfony creates new relation them. just want assign category id task object, no create new category . here task object: <?php namespace acme\taskbundle\entity; use doctrine\orm\mapping orm; use symfony\component\validator\constraints assert; /** * @orm\entity * @orm\table(name="tasks") */ class task { /** * @orm\id * @orm\column(type="integer") * @orm\generatedvalue(strategy="auto") */ protected $id; /** * @orm\column(type="string", length=200) * @assert\notblank( * message = "task cannot empty" * ) * @assert\length( * min = "3", * minmessage = "task short" * ) */ protected $task; /*...

oracle11g - Oracle 11gR2 installation in Windows server 2012 -

while installing oracle 11gr2 gives error [ins-13001] environment not meet minimum requirements. i've looked @ prerequisites given @ oracle website, seems there. there log file genereated, not able tell it's looking for. sing paramfile: e:\win64_11gr2_client\win64_11gr2_client\client\install\oraparam.ini checking monitor: must configured display @ least 256 colors. actual 4294967296 passed commandline unzip: e:\win64_11gr2_client\win64_11gr2_client\client\install\unzip -qqqo ..\stage\components\oracle.jdk\1.5.0.17.04\1\datafiles/"*.jar" -d "c:\users\shakyrx\appdata\local\temp\2\orainstall2013-09-24_12-04-54pm" info: loading data from: jar:file:/c:/users/shakyrx/appdata/local/temp/2/orainstall2013-09-24_12-04-54pm/ext/jlib/installcommons_1.0.0b.jar!/oracle/install/driver/oui/resource/configcommandmappings.xml info: loading beanstore jar:file:/c:/users/shakyrx/appdata/local/temp/2/orainstall2013-09-24_12-04-54pm/ext/jlib/installcommons...

javascript - How to set URL query parameters in Visual Studio on Start Page -

rewording learned 'answering own question on encouraged', didn't use correct procedure. jeopardy version. i'm building javascript/html5 web site using visual studio 2012 web. need feed in query parameter selected start page. vs web allows right-click on html page , select 'set start page', no way set start options. how can set query options on launch of web page debugger? you need right-click on project , go 'start options...' . in start options dialog can add query parameters 'specific page:' option. drop-down in specific page allowed modify url add own parameters. e.g. mystartpage.html?myparameter=3 you can't use start url option internal debugger since since have specify 'localhost:port/mystartpage?myparameter=3'. vs unhappy , ends 404 page.

How to use variables in hyperlink using asp.net -

i using php , asp.net pass variables on page using hyperlink. bit of code: <h3><?php echo $product["01"]["model"]; ?></h3> <div class="image_box"> <img src="images/product/01.jpg" alt="" /> </div> <p><?php echo $product["01"]["brand"]; echo " "; echo $product["01"]["model"]; ?></p> </div></a> so there image, brand , model displayed on first page. when clicks div, redirected new page called "product details" find of details of product they've clicked on. done asp.net ( <a href="productdetail.aspx?brand=jori&model=icecube> ). here, brand , model passed next page can use data. but there way can replace <a href="productdetail.aspx?brand=jori&model=icecube> <a href="productdetail.aspx?brand=$product["01"]["brand"]...

ruby on rails - Mongoid Geo Near Average Distance unit? -

this how calculating average distance betwoon 2 indexed locations; :distance => user.where(:email => worker).geo_near(pb.location).average_distance.round(5) it giving me number right can't find out unit in? or how can convert in miles. example giving me 3.97... distance between la , lv.

c# - Reading data from sitecore webforms for marketeers database -

i want build custom interface (a separate aspx page) manage data put webforms marketeers (wffm) database, , 1 form. must possible edit data , select records particular sortings , pagings. database configured sqlite. is possible , recommended, or plain xml saved wffm database? , how should go it? this doable, though select query data out of wffm bit funky because stored loose in 1 huge table called "field" trail of guids tie stored values form came , field. provided below part of export excel utility wrote wffm data. builds datatable object submitted form results. adapt other structure without work though. public string connectionstringwffm = "user id=sitecore_admin;password=xxx;data source=sitecoredbserver.com;database=sitecore_webforms"; protected datatable builddatatable(item formitem) { list<formresult> formresults = formresults(formitem.id.guid); list<field> distinctfields = distinctfields(formitem.id.guid); var dt = ...

C++ memory leak with 2d array pointer -

the 3 functions below contain memory leaks @ lines marked "// memory leak vvv" according dr. memory. i'm relatively new c++ , pointers , not sure why these lines causing leaks. "values_" t** , member variable undoarray class. template <class t> void undoarray<t>::set(size_type i, const t& v) { counts_[i]++; if(!initialized(i)) { // memory leak vvv values_[i] = new t[1]; values_[i][0] = v; } else { // memory leak vvv t* temp = new t[counts_[i]]; for(int j = 0; j < counts_[i] - 1; j++) { temp[j] = values_[i][j]; } temp[counts_[i] - 1] = v; delete [] values_[i]; values_[i] = temp; } } template <class t> void undoarray<t>::undo(size_type i) { counts_[i]--; if(counts_[i] == 0) { values_[i] = null; } else { t* temp = values_[i]; // memory leak vvv values_[i] = new t[counts_[i]]; ...

ios7 - iOS 7 UISearchDisplayController search bar disappears -

Image
i updating app , came across issue. when start typing in search bar search bar disappears , can see table view. can still keep on typing , table view gets updated cannot see search bar. same settings works fine on ios < 7 any idea why happening ? a little late, i've encounter same problem recently. wanted search bar visible , active through of search, dimmed view, overlaid it, big problem. me thing worked changing frame of dimmed view (apparently it's not same changing frame of searchresultstableview). i've managed following code: -(void)setcorrectframes { // here set frame avoid overlay cgrect searchdisplayerframe = self.searchdisplaycontroller.searchresultstableview.superview.frame; searchdisplayerframe.origin.y = cgrectgetmaxy(self.searchdisplaycontroller.searchbar.frame); searchdisplayerframe.size.height -= searchdisplayerframe.origin.y; self.searchdisplaycontroller.searchresultstableview.superview.frame = searchdisplayerfra...

javascript - Simple way to toggle a button's value -

like title says i'd user click button , new value. in case button toggle menu hidden visible , , forth. here code. i want "show menu" , "hide menu" right click, menu opens , new value set , menu can close value doesn't go back. jquery: $(function () { $("#uicontainer").hide(); $("#button").click(function() { $("#uicontainer").toggle( function() { $("#button").val('hide menu'); }); }); }); $(function () { $("#uicontainer").hide(); $("#button").on('click', function() { $("#uicontainer").toggle(); this.value = this.value == 'hide menu' ? 'show menu' : 'hide menu'; }); }); fiddle

windows 8 - What is the merchant id? -

i'm having issues getting paypal integrated windows 8 app. i'm not sure "merchantid" suppose be, i'm assuming terminology doesn't line on developer portal? in code sample, execute() returns false without showing prompt: buynow buynow = new buynow([i've tried several ids found portal]) { usesandbox = true, }; itembuilder itembuilder = new itembuilder(this.product.name); itembuilder.description(this.product.description); itembuilder.name(this.product.name); itembuilder.price((product.saleprice ?? product.price).tostring()); itembuilder.quantity(1); itembuilder.id (this.product.id.tostring()); item item = itembuilder.build(); buynow.additem(item); bool buynowresult = await buynow.execute(); alright, next person. 'merchantid' refers 'merchant account id' found on www.sandbox.paypal.com site under profile -> business info. i having issues because string entering description long. sure hook error event meaningful error...

Is it possible to view multiple burndown charts in tfs -

i know if possible watch multiple burndown charts in 1 page. we're using tfs , have several projects in course. boss wants see in 1 page burn downs of these projects, having kind of dashboard. know if tfs has it? otherwise have create webpage , link them there's nothing out of box lets @ burndowns portfolio of team projects. you'll have create web page.

vtk - How to generate a key press event in traitsui (Mayavi)? -

i have mayavi scene widget toolbar , want add button same behaviour pressing ctrl+c, ctrl+a (change between camera , actor interactor mode). i think simulating key press event cliking in button simplest aproach that, question ¿how simulate key press event in traitsui (the mayavi gui toolkit)? does know way perform same action ctrl+c, ctrl+a? thanks in advance! there no straightforward way simulate keypress event in mayavi scene or aware of in traitsui or enaml. this extremely non-traithonic way of getting desired behavior. right way make calls tvtk interactor, asking right style: self.scene.interactor.interactor_style.set_current_style_to_trackball_camera() self.scene.interactor.interactor_style.set_current_style_to_trackball_actor()

python - Using BeautifulSoup to parse facebook -

so i'm trying parse public facebook pages using beautifulsoup. i've managed scrape linkedin, i've spent hours trying work on facebook no luck. code i'm trying use looks this: for urls in my_urls: try: page = urllib2.urlopen(urls) soup = beautifulsoup(page) info = soup.find_all("div", class_="fsl fwb fcb") info2 = info.findall('a') the part that's frustrating me can title element out, , can pretty far down document, can't part need get. this line successfuly grabs pagetitle: info = soup.find_all("title", attrs={"id": "pagetitle"}) this line can pretty far down list of elements, can't go farther. info = soup.find_all(id="pagelet_timeline_main_column") here's sample page i'm trying parse, want current city it: https://www.facebook.com/100004210542493 and heres quick screenshot of part want looks like: http://prntscr.com/1t8xx6 i feel i'm clo...

javascript - scrap data using Nokogiri available in span tag -

how scrap name , price of product of page http://www.tradus.com/t-shirts-tees-reebok-puma-fifa-teesort/t/7682?type=polo+neck using nokogiri , how scrap product of category pagination there.following code getting price in html tags , 1 page. require 'nokogiri' require 'open-uri' url = "http://www.tradus.com/t-shirts-tees-reebok-puma-fifa-teesort/t/7682? type=polo+neck" doc = nokogiri::html(open(url)) doc.css(".prodlisting-item").each |dv| product_name = dv.at_css('.prod-name').text unless dv.at_css(".prod-name").nil? product_price = dv.at_css('.price-info span span:nth-child(2)').to_s puts product_name + product_price end following code resolved issue require 'nokogiri' require 'open-uri' number=1 while true url="http://www.tradus.com/t-shirts-tees-reebok-puma-fifa-teesort/t/7682? type=polo+neck&page=#{number}" doc = nokogiri::html(open(url)) products=doc.css(".prodlisti...

xcode5 - Navigation bar is pushed down in iOS7 -

Image
i compiling app ios 6.1 sdk , deploying in ios7 device. app's device set iphone only. i have view controller add navigation controller. self.window.rootviewcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller: [[myviewcontroller alloc] init]]; when deploy app in ipad mini running ios 7, there strange gap shown @ top. if set app's device universal, gap goes away. there explanation this? thanks. the few changes should take care of in ios 7:- 1) navigation bar of ios 7 of dimension :- 320 x 64 while ios 6 :- 320 x 44. 2) navigation bar translucent property yes default in ios 7 set no, status bar included in ios 7. take care of these things , go fine. // sample code of setting navigation controller , image programatically in ios 7 self.navigationcontroller.navigationbar.translucent=no; [self.navigationcontroller setnavigationbarhidden:no animated:yes]; uiimage *b...

jboss7.x - Place jboss-ejb-client.properties file on your classpath but how to Client Classpath? -

jboss7.1 final, how find client classpath or location jboss-ejb-client.properties file should go? if run app terminal, then: folder witch app executed if app packaged jar, root of jar, or add class-path entry in manifest.mf points folder file jre lib/ext folder (not recomended) run java -cp argument

How to write multiple count select statement in sql -

i need combine 2 count statement 1 select. can done? select dealer ,firstname ,producttype ,date ,comments ,count(*) total select dealer ,firstname ,valid ,comments ,count(*) invalidtotal you use union statement create single query, return 2 rows. howwever, column name count(*) column come first query, add flag, such isvalid column in example below select vr.dealerid ,vr.commissionrunid ,vd.producttype ,vd.valid ,vd.comments, 1 isvalid, ,count(*) total union select vr.dealerid ,vr.commissionrunid ,vd.valid ,vd.comments 0 isvalid, ,count(*) invalidtotal however, if looking 1 row, i.e. select vr.dealerid ,vr.commissionrunid ,vd.producttype ,vd.valid ,vd.comments, ,count(*) total ,count(*) invalidtotal. then need see how determine valid vs invalid counting purposes. doable, need create case statement returns 1 or 0 (for valid or invalid) , sum columns. without knowing sql dialect, f...