Posts

Showing posts from June, 2012

c# - Upload File from modal popup -

i have modal popup, inserting new records on database table. records inserted except upload file. neither filename inserted on database table neither file uploaded on folder. when run code on page not modal popup code works. working on localhost. code: string myfileuploadpath; if (myattachedfile.filename != "") { fileuploadpath = "~\\myfiles\\" + myattachedfile.filename; string mypath = server.mappath(myfileuploadpath); myattachedfile.saveas(mypath); myitem.attachedfiles = myfileuploadpath; } <asp:placeholder id="placeholder1" visible="false" runat="server"> <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <asp:fileupload id="myattachedfile" runat="server" /> </contenttemplate> </asp:updatepanel> </asp:pla...

php - How do you set the Safari browser title with UTF-8 characters in javascript? -

i have updated question make clearer: i sending word "Über" value in php header response ajax request so: header('title: ' . 'Über'); the word "Über" comes database columns set utf8_general_ci , when echo out word database see correctly. the problem occurs in javascript when do: var title = request.getheader('title'); i do: console.log(title); in chrome value of title correct (Über), in safari , firefox converted "Ãber". i think problem might i'm sending value in header rather normal response string. any appreciated. quentin right. sending raw unicode in header caused problem. changed normal ajax request , fixed things. help.

refactoring - LINQ select item from a list where string contains any of the search terms in a list -> refactor -

i have list of items, called translations. filter translations based on search term search box, looks this: private static ilist<translation> filtertranslationlistold(string filter, ienumerable<translation> translationlist) { filter = filter.tolower(); if (!string.isnullorempty(filter)) { return translationlist .where(t => (t.tag.filename.tolower().contains(filter) || t.tag.filepath.tolower().contains(filter) || t.tag.tagcontent.tolower().contains(filter) || (t.tag.sanitizedtagcontent != null && t.tag.sanitizedtagcontent.tolower().contains(filter)) || (t.tagtranslation != null && t.tagtranslation.tolower().contains(filter)) || (t.sanitizedtranslation != null && t.sanitizedtranslation.tolower().contains(filter)))) .orderby(t => t.tag.filepath) .t...

php - magento - documentation for public interface of magento core models -

let's have code: $order = mage::getmodel('sales/order')->load($orderid); i know methods can call on $order object. there online reference can find available methods? trying write own module (observer more precisely) , need access order object , instance pull user out of it. can't find docs (reference) can achieve goal. you can try code $class_name=get_class($order); $methods =get_class_methods($class_name); echo "methods available"; foreach($methods $method) { var_dump($method); }

Error with computed size of relative-size HTML elements in javascript -

my window object has width of 1361px. a container div has width set 90%, theorically makes 1224.9px. however, computed size of ( $("#mycontainer").width() ) returns 1225px. fyi, computed number seems come browser itself, not jquery. now, problem if put 2 floating divs in it, respectively 1000px , 225px, not fit on same line, allegedly because 1225px > 1224.9px. @ least in ff , chrome, not tested elsewhere. if set container fixed size of 1225px, 2 divs on same line, confirms in mind browser not use superior-rounded computed size know how space available children occupy. i wanted know if knew how solve this. not sure how percentage size of container maths myself : var width = math.floor($(window).width * $("#mycontainer").percentagewidth() / 100) thank you. css display: flex; way fix these quirks nowadays.

javascript - If I create OOP JS code using prototype, how do I reference a class method from a loop? -

i'll show code first: function messages(){ this.postresponsebutton = '#postresponsebutton'; $(document).ready(this.setevents); } messages.prototype.setevents = function(){ $(self.postresponsebutton).click(function(){ this.postresponse(); // error here }); } messages.prototype.postresponse = function(){ console.log('post response'); } var messages = new messages(); in marked line ("error here"), it's not recognizing messages.postresponse() function when call this.postresponse() . i've tried self.postresponse() without success. i'm sure it's problem of scope; i'm not sure how refer actual object. need set var me = this , use that, or something? thanks time! as have said, problem context of click event handler not same function in appears. either bind (es5, won't work in old browsers) function this : messages.prototype.setevents = function(){ $(self.postresponsebutton).click(f...

LoadModel does not load in XNA, C# Express Edition -

i use windows xp, msc# 2008 express edition, xna 3.0. try load model in classic way : model = content.loadmodel("mymodel"); in folder content have files : "mymodel.fbx" , "mymodel_texture.png". when start debugging receive message: error loading "mymodel". file not found when start without debugging message "game" (name of program) has encountered problem , needs close , asks whether send or not info ms. i try adding model to contentmanager "add existing item". files exist; put absolute path. have same problem. what do?

svn - 1.5.0 or better of the Subversion Python bindings -

when try commit tortoise svn, shows : post-commit hook failed (exit code 1) output: error: need version 1.5.0 or better of subversion python bindings. how should solve this? thanks! you have outdate of python-svn binding. need install newer kits: here: http://pysvn.tigris.org/servlets/projectdocumentlist?folderid=1768 i not sure whether tortois installation brings it's own version of these python-bindings.

java - using a predefined String in a GUI -

i have gui set way want i'm trying output string called answerkey have predefined in dashreplace() tried draw string , use jlabel can't seem find right method of doing such. import java.awt.*; import java.awt.event.actionlistener; import java.util.arraylist; import java.util.arrays; import java.util.collections; import javax.swing.*; public class hangmanpanel extends jpanel { private static final long serialversionuid = -5793357804828609325l; public static string answerkey() { //get random array element string array[] = new string[10]; array[0] = "hamlet"; array[1] = "mysts of avalon"; array[2] = "the iliad"; array[3] = "tales edger allan poe"; array[4] = "the children of hurin"; array[5] = "the red badge of courage"; array[6] = "of mice , men"; array[7] = "utopia"; array[8] = "chariots...

php - Getting the name of an array dynamically -

i have array looks this: $example = [ ['rendered'][0]['rendereditem1'] ['rendered'][4]['rendereditem2 , more'] ['rendered'][2]['rendereditem3'] ] now want iterate foreach contents of 0,4,2! normally write: foreach($example $value){ print $value['rendered'][int same everywhere]; } but not working because array name different...how iterate in case? simply add second loop iterate on members : foreach($example $value) { foreach($value['rendered'] $key=>$item) { // want here, $key 0,4,2 in example } }

Requesting Assistance In Getting My Head Around Facebook Login for Websites -

i'm wanting implement "login facebook" that's common on websites i'm having trouble grasping whole concept , if assist me i'd appreciative. i've been reading documentation under link https://developers.facebook.com/docs/facebook-login/ days still don't "get it". let's start with... in documentation, says js sdk easiest use (for whom dont know) i'm thinking non js version better , faster (and easier me grasp) don't know do. i'm "stuck" my main problem don't understand how suppossed able insert auto incrementing id along person's first , last name db. there's nothing or in facebook code specify db, table or column how data suppossed db log user in?? i have classifieds on site of i'm attempting create fb login said above, i'm stuck , use have intermediate level of knowledge regarding php , mysql like discussed in comments, here's example using js sdk <!doctype html...

function - MinGW Main routine -

in c there no main program. sure, c programmers begin int main(int argc char *argv[]), works because there routine tells compiler/ide run function named main first. i can't seem find routine in mingw, though. defined? searched because wanted change (only test) , play around bit. can link me correct file in mingw folders? the ld linker match of 1 of several symbols use entry point when linking pe file: entry point subsystem --------------------- -------------- ntprocessstartup native winmaincrtstartup windows gui maincrtstartup windows cui (console) __posixprocessstartup posix cui winmaincrtstartup wince gui maincrtstartup xbox maincrtstartup other dllmaincrtstartup@12 (or possibly dllmaincrtstartup) dlls mingw have object file gets automatically linked in has actual pe entry point. - can see object files being automatically linked in using gcc's -v option. in quick test ...

jquery - Using select tag as navigation to other pages? -

i need make navigation of website work drop down select tag. realise involve bit jquery. how html looks far : <div id="top_nav"> <select> <option value="">1</option> <option value="">2</option> <option value="">3</option> <option value="">4</option> <option value="">5</option> <option value="">contact</option> </select> so when user selects 2 example, takes them page 2 of site. appreciated. thanks angela if using jquery on page, can that: <div id="top_nav"> <select> <option value="page1.html">1</option> <option value="page2.html">2</option> <option value="page3.html">3</option> <option value="page4.html">4</option> <option value="page5.html...

php - Conditional Javascript Redirect With Back Button Checker -

i have done conditional redirect javascript (depending of referer). need detect if user got redirected , clicked button , got again page has been redirected from. in case need no redirect him again. i have found solution here - failed combine php , javascript properly, there error - how detect if user has got page using button? code: <form name="ignore_me"> <input type="hidden" id="page_is_dirty" name="page_is_dirty" value="0" /> </form> <script language="javascript" type="text/javascript"> var dirty_bit = document.getelementbyid('page_is_dirty'); if (dirty_bit.value == '1') { document.write("<p>do not redirect</p>"); } else { <?php if((stristr($_server['http_referer'],"thoughts") != false) { ?> <?php $setupform = '<form id="form1" method="post" action="http://yahoo.com">...

javascript - aoData is null when using multiple instances of jquery datatable -

scenario: on webpage have 3 divs contain table tags. there 3 buttons, clicking on each button creates instance of datatable on particular div table tag. the datatable gets data serverside all data returned , displayed, pagination, filtering works fine. so when 3 instances created, using fnsettings() on last instance created returns proper object, , other 2 instances return null so using fndata() etc api methods throw error saying : "typeerror: cannot read property 'aodata' of null" because settings object of datatable instance somehow null code description i have made class called datagrid, , create multiple instances of class: /** * datagrid class contains methods , properties in controllling , manipulating multiple instances of datagrid class * * function constructor datagrid class * * @param {string} domcontainerselector dom selector of element containing datagrid * @param {array} columns definitions of columns of datagrid * @param {...

haskell - Merge multiple lists if condition is true -

i've been trying wrap head around while now, seems lack of haskell experience won't me through it. couldn't find similar question here on stackoverflow (most of them related merging sublists, without condition) so here goes. let's have list of lists this: [[1, 2, 3], [3, 5, 6], [20, 21, 22]] is there efficient way merge lists if sort of condition true? let's need merge lists share @ least 1 element. in case of example, result be: [[1, 2, 3, 3, 5, 6], [20, 21, 22]] another example (when lists can merged): [[1, 2], [2, 3], [3, 4]] and it's result: [[1, 2, 2, 3, 3, 4]] thanks help! i don't know efficiency, can break down what's going on , several different functionalities @ least. particular functionalities might optimizable, it's important clarify what's needed. let me rephrase question: for set x, binary relation r, , binary operation +, produce set q = {x+y | x in x, y in x, xry}. example, might have x being set ...

java - Jar file failed to run when exported from MyEclipse -

Image
i have written program used java media framework (jmf) library capture video camera , display video, when run program in eclipse work will, when export program runnable jar file, program cannot detect device. have done experiment share below. i installed jfm in c drive , add libraries c drive eclipse (c:\program files\jmf2.1.1e\lib) in case program run eclipse working will, when copied libraries (c:\program files\jmf2.1.1e\lib) inside project in eclipse, same problem happen cannot detect device. don’t know how solve problem, if knows can suggest me. in advance! i have tried below 3 options export, same problem happened: but when select first option eclipse warn below:

java - Weird characters after processing a xml file in android -

Image
i making andorid applicaiton loads data xml file. problem xml file not processed correctly , not able serialize it, because of that. think problem related encoding of file. how made xml file? eclipse have clicked on new-> file -> , created blank xml, i've filled needed information. here how xml looks in editor: <?xml version="1.0" encoding="utf-8"?> <data> <categories> <category value="inbox"/> <category value="private"/> <category value="work"/> <category value="business"/> </categories> <todos> <todo> <id>1</id> <text>explore app!</text> </todo> <todo> <id>2</id> <text>add more todos!</text> <date>2013-05-09 12:21:55 cet</date> </todo> </todos> </data> i getting xml file res/xml , load...

c# - .net Chart x axis value is not displayed under the column -

Image
for code below foreach (leavetype lvtype in statsforbp.leavespertype.keys) { var series = new series(); series.points.addxy(lvtype.typeofleave.tostring(),statsforbp.leavespertype[lvtype]); series.smartlabelstyle.enabled = false; chart.series.add(series); } i following result. any ideas how bring x value directly below? try create datapoint separately , add axislabel, this: datapoint dpvalue = new datapoint(); dpvalue.setvaluey(value); dpvalue.axislabel = "label";

jquery - offset().top doesnt count the height of chrome extention toolbar -

i trying offset top of element, appears if there kind of gooogle chrome extention toolbar - loads after page loaded in iframe , height not counted in offset().top. i running jquery function on (window).load(), maybe not correct? it's noticed happening. might best practice make calculations in window's onresize event: $(window).load(function() { $(window).trigger('resize'); }); $(window).resize(function() { // offset().top; calculation here, when window loads , each time window resized. }); also, post full example of code (css, html, js) in jsfiddle . have hunch .position() work better .offset(), possibly minor css/html tweaks but, can't tell without seeing code.

symfony - Symfony2 choice field not working -

i asked question here how use repository custom functions in formtype nobody anwsered, did little digging , advanced little still error: notice: object of class proxies\__cg__\kpr\centarzdravljabundle\entity\category not converted int in /home/kprhr/public_html/cz_symfony/vendor/symfony/symfony/src/symfony/component/form/extension/core/choicelist/choicelist.php line 457 now how categorytype looks like: <?php namespace kpr\centarzdravljabundle\form\type; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; use symfony\component\optionsresolver\optionsresolverinterface; use symfony\bridge\doctrine\registryinterface; class categorytype extends abstracttype { private $doctrine; public function __construct(registryinterface $doctrine) { $this->doctrine = $doctrine; } public function setdefaultoptions(optionsresolverinterface $resolver) { $resolver->setdefaults(array( 'data_...

adding breakpoint at the closing brace of main-visual studio-c++ -

i starting learn c++ , keep console window closing in visual studios read add breakpoint @ closing brace of main. like? give quick example please? , please don't bag on me using visual studios, starting learn c++ , plan on learning how use different complilers in future, need specific answer specific question. to set breakpoint in visual studio, click in left-hand margin. should see little red circle. a breakpoint, regardless of ide, point in code debugging tool inserts itself. when program reaches position indicated breakpoint, program stops, , gives control debugger. in turn allows see mid-execution details of program (as preventing progressing further along in execution) useful reference guide debugging in general (including breakpoints): http://www.codeproject.com/articles/79508/mastering-debugging-in-visual-studio-2010-a-beginn

php - File not being created even though write permissions exist -

i followed selected answer in this question , trying export in memory variable .php file. later require_once php file made. the problem php file never being made. when try require it, error (http 500 code depends on 1 variable , because file not exist). the error log says file can not required because there no such file or directory. the dir trying make file in has 755 permissions. here code using export variable file: $variable_export = var_export($elasticaobject, true); $variable = "<?php\n\n\$$elasticaobject = $variable_export;\n\n?>"; file_put_contents('theindex.php', $variable); any idea doing wrong , why file theindex.php not being made? your mode may insufficiant. 755 = rwx (owner), rw (group , others). group , others may read , cross folder. that issue if user launch php not owner of folder. try chown user:group on folder, php-user (probably webserver) write in it. cheers, k.

mvvmcross - MvxSimpleIoCContainer and multiple concrete implementations -

if have interface imvxscreen , multiple concrete classes implement imvxscreen , possible resolve implementations @ once? public myclass(iscreen[] screens) { no - isn't possible. you have provide separate interface/object - e.g. iscreenservice . assuming screens in same assembly, guess provide using service like: public interface iscreenservice { ienumerable<iscreen> createall(); } public class screenservice : iscreenservice { public ienumerable<iscreen> createall() { return this.gettype().assembly .creatabletypes() .inherits<iscreen>() .select(t => mvx.iocconstruct(t)); } }

javascript - Ext js - diffrence between applyTo and renderTo -

i've started learn ext js , couldn't find difference between applyto , renderto i think this answer helpful in explaining difference between 2 , more...

java - String Date Value Converting -

i converting string date format. returns "unparseable date" . example, string date= "wednesday, may 15, 2013"; i want convert string "2013-05-15" how that? use simpledateformat twice: once parse date , other render in desired format: date date; string display = new simpledateformat("yyyy-mm-dd").format( new simpledateformat("eeee, mmmm dd, yyyy").parse(date) ); your example date unfortunate, because uses 3-letter month "may", can't tell if month names truncated 3 letters, or if full name. have assumed months full name, if truncated, change mmmm mmm in second format string.

javascript - Why isn't my JS working (in wordpress)? -

what i'm trying have number count-up on page increases @ steady increment/interval. created stylized images represent each number 0-9 in count-up, need replace each number respective image. first function in code represents task, , second script actual count-up. i'm using wordpress i've added js file , enqueued in header.php file. here's had problem: able count-up work, counterimages(input) function doesn't want work me. might issue how trying "call" on function on wordpress page. if me out grateful! function counterimages(input) { var output = "" (var = 0; < input.length; i++) { var chr = input.substring(i, + 1) if (chr == '£') { output += '<img border="0" src="img/pound.gif">'; } else if (chr == '.') { output += '<img border="0" src="img/dot.gif">'; } else { output += '<img border="0" src=...

javascript - Page has two scripts. One runs on all browsers. One fails on IE7. -

i'm no js expert i've minimised faulty script , tried localise fault without success. can find actual page @ www.trinitywoking.org.uk. minimal test case is <!doctype html> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type"> <title>mintestcase</title> <script>window.onload = function () { // don't run script until page loaded var votd = new array(); votd[129]="mount sinai smoke because god had come down on fire."; // prepare today's string display document.getelementbyid("keyverse").innerhtml="<p> " + votd[(129)] + "</p> "; } </script> </head> <body> <h1>target paragraph follows </h1> <p id="keyverse"> </p> </body> </html> this runs , displays correctly on browsers except ie lte 8. second script runs on browsers doesn't permissions issue. i'll...

Load times with @font-face vs. Google fonts or localhost files vs. CDN's -

is loading fonts via storing them on server , using @font-face slower loading them google's font api? or depend on font , vary situation situation? and same javascript , other similar files: faster or slower load cdn's store files on server , load them (locally on server)? or there many variables involved situation situation generalize single answer? imagine depends on cdn you're accessing and/or personal server settings , size/nature of files you're loading, etc, curious if there might general rule or strategy knowing faster? a cdn might faster, on base built speed in mind (high performance, tuned web servers, caching...) , composed network of geographically distributed servers, lowering latence both because nearer , because share load. also, directly placed on backbones, allow faster transfer rates low-to-mid-priced server ever do. thus said, low traffic website visited 1 specific country, in turn near server location, difference in load irrelevant...

javascript - How to use one-way binding on emberjs? -

i'm starting play around ember 1 thing haven't been able wrap head around how use one-way bindings, consider following code: html <script type="text/x-handlebars"> <h1>some app</h1> <p> name is: {{name}} </p> <form {{action 'updatename' on="submit"}}> {{view ember.textfield valuebinding="name"}} <input type="submit" value="save"> </form> </script> js var app = ember.application.create(); app.applicationroute = ember.route.extend({ model: function() { return { name: 'john doe' } }, events: { updatename: function() { console.log('name updated!'); } } }); js fiddle reference by default ember.textfield 's value bound model , viceversa means when type on text model , view updated live, i'm trying bind model textf...

Paypal - Using Classic API for purchases and REST API for refunds -

we're in process of migrating paypal rest apis , have updated our refund process classic api rest. we're little hesitant turn on because we're still using classic api purchase transactions. using classic api purchases , rest api refunds cause issues? yes cause issues. payments made rest api can refunded via rest api. rest api uses different set of ids data model not analogous/compatible ids used classic apis (at point). https://developer.paypal.com/webapps/developer/docs/api/#refund-a-sale - shows how new rest apis refund sale, saleid available payments made new rest api.

for loop - AWK Script wildcard -

i need awk script ( how add wild card perform task described below). have file , submit every night external party. format of file {dateformat (yyyymmdd)} xxx1.csv. have xxx1 , xxx2 only. lately start getting .3 , .4 files. capture .3 , .4 manually , submit it. able have wildcard grab .3 , .4 automatically don’t miss accident. suggestions please? thank in advance it sounds question how use file name globbing in shell, not awk. might you're looking for: cmd [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]???[0-9].csv where "cmd" can awk, sed, grep, ls, whatever. depending other files have in directory might not need specific globbing pattern.

python - Fill NaN in candlestick OHLCV data -

i have dataframe this open high low close vol 2012-01-01 19:00:00 449000 449000 449000 449000 1336303000 2012-01-01 20:00:00 nan nan nan nan nan 2012-01-01 21:00:00 nan nan nan nan nan 2012-01-01 22:00:00 nan nan nan nan nan 2012-01-01 23:00:00 nan nan nan nan nan ... open high low close vol 2013-04-24 14:00:00 11700000 12000000 11600000 12000000 20647095439 2013-04-24 15:00:00 12000000 12399000 11979000 12399000 23997107870 2013-04-24 16:00:00 12399000 12400000 11865000 12100000 9379191474 2013-04-24 17:00:00 12300000 12397995 11850000 11850000 4281521826 2013-04-24 18:00:00 11850000 11850000 10903000 11800000 15546034128 i need fill nan according rule when open, high, low, close nan, set vol 0 set open, high, low, close previous close candle value else ...

ruby - PTY gem not found -

i have ruby 1.9.3 installed on windows. when try require gem console outputs gem not found: require 'pty' which outputs: 'require': cannot load such file -- pty <loaderror> also tried: gem install pty and got output: could not find valid gem 'pty' in repository how fix this? as far know, there no pty module implementation windows don't have pseudo-terminal capabilities.

.htaccess - Rewrite Rule not Working in IIS Server with PHP -

hi, friends. i'm creating .htaccess file rewrite rules. it's working fine in localhost, on live, server it's not working. hosting uses window server. i wrote rule in .htaccess file: rewriteengine on rewritebase /project_name/ rewritecond %{request_filename} !-f rewritecond %{request_uri} !example.php rewritecond %{request_uri} !(.*)/$ rewriterule (.*) pages.php?page_slug=$1 [l] for case of wordpress run on iis server , need create web.config in root directory put code below, <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webserver> <rewrite> <rules> <rule name="wordpress" stopprocessing="true"> <match url=".*" /> <conditions logicalgrouping="matchall"> <add input="{request_filename}" matchtype="isfile" negate="true" /> <add input=...

asp.net - Ask the user for number of file to upload -ASPX -

i'm trying build website (i learning whole subject now), , maybe anwser simple. i devaloping in aspx/c#, , want in form, there select field ( <select> ) option of number of files upload, max files upload 4. i want after select number of files, there up;oad fields (in number chose). my question how can that? (maybe javascript of ajax ? have no idea how) wish help, thanks. i not sure if looking for, give try try this: http://jsfiddle.net/2bzwd/ `$('#select1').change(function(){ var count = $(this).val(); var uploadcount = 0; $('.upload').each(function(){ if (count > uploadcount) { $(this).show('slow'); uploadcount++; } else { $(this).hide('slow'); } }); });`

gnu make - How to print out a variable in makefile -

in makefile, have variable 'ndk_project_path', question how can print out when compiles? i read make file echo displaying "$path" string , tried: @echo $(ndk_project_path) @echo $(value ndk_project_path) both gives me "build-local.mk:102: *** missing separator. stop." any 1 knows why not working me? you can print out variables makefile read (assuming gnu make have tagged question appropriately) using method (with variable named "var"): $(info $$var [${var}]) you can add construct recipe see make pass shell: phony: all: ; $(info $$var [${var}])echo hello world now, happens here make stores entire recipe ( $(info $$var [${var}])echo hello world ) single recursively expanded variable. when make decides run recipe (for instance when tell build all ), expands variable, , passes each resulting line separately shell. so, in painful detail: it expands $(info $$var [${var}])echo hello world to first expands $(info $$va...

php - Adapter Db\NoRecordExists Error [Zend 2] -

catchable fatal error: argument 1 passed zend\validator\db\abstractdb::setadapter() must instance of zend\db\adapter\adapter, null given, called in /home2/mapasgua/vendor/zendframework/zendframework/library/zend/validator/abstractvalidator.php on line 142 , defined in /home2/mapasgua/vendor/zendframework/zendframework/library/zend/validator/db/abstractdb.php on line 168 module.php <?php namespace user; use zend\mvc\mvcevent; use zend\mvc\moduleroutelistener; use user\model\userstable; use user\model\users; class module { public function onbootstrap(mvcevent $e) { ini_set('date.timezone', 'america/sao_paulo'); $e->getapplication()->getservicemanager()->get('translator'); $eventmanager = $e->getapplication()->geteventmanager(); $moduleroutelistener = new moduleroutelistener(); $moduleroutelistener->attach($eventmanager); $e->getapplication()-...

c# - NavigationProperty null on added foreign key -

Image
whenever add foreign key entity previous entity setting foreignkey-id, associated object null. let me explain this: in previous step i've set addressid property 28 , have saved entity context calling context.savechanges() . now why addressid filled, address navigationproperty (which should address object of address table address.id == 28 ) null ? entity frameworks (ef) work design. updating foreign key never updates navigation property. however, updating navigation property update key. note in case address entity should come same context. if not .savechanges() consider address entity new , try add in database. as question of method better, well, depends! - updating key straightforward , have been doing along using data transfer objects (dtos) or plain sql. easier newcomers ef grasp , use. - updating navigation property object based data model. code looks cleaner , more readable. need careful context. in little personal experience ef, find trying u...

Unable to get Oracle Package function to execute in c# -

i'm having difficulty trying call dba's function inside c#. works fine in oracle query browser, when attempt execute in c# fails. the common error : "ora-06502: pl/sql: numeric or value error: character string buffer small ora-06512: @ line 1" i've attempted increase size of c# parameters no success. not sure i'm doing wrong. c# code : string returnvalue = string.empty; using (oracleconnection cn = new oracleconnection("connectionstring")) { using (oraclecommand cmd = new oraclecommand()) { cmd.connection = cn; cmd.commandtext = "package.function"; cmd.commandtype = commandtype.storedprocedure; oracleparameter param1 = new oracleparameter(); oracleparameter param2 = new oracleparameter(); oracleparameter param3 = new oracleparameter(); oracleparameter param4 = new oracl...

Count values of the inner two-dimensional array - javascript -

i have two-dimensional array. i'm trying count values within inner array. i'm aware of js array.length . doing testdata.length yields 5. accurate. however, want count number of items within each sub array. testdata[0].length yield 6. how dynamically count through each sub array? (as change). var testdata = [["column1","test1","test1","tea","party", "water bottle"], ["column2","test2","test2","test2 test2"], ["column3","test2","test2","test2 test2 "], ["column4","test2","test2 test2f asdfsdf"], ["column5","test2","test2 test2f asdfsdfasdfasdfasa asda asdfsas"] ] var testdata = [["column1","test1","test1","tea","party", "water bottle"], ...