Posts

Showing posts from September, 2011

Django StackedInline does not work in CmsPlugin -

in cms adminpanel have inline cmsplugin in django. here code: class myentryinline(stackedinline): model = myrelatedmodel = 2 class mycmsplugin(cmspluginbase): model = mypluginmodel render_template = "cms_plugins/my_template.html" inlines = [myentryinline,] the add_view works well. however, change_view not show me inlines()... it seems bug or limit of django-cms. django version = (1, 4, 5, 'final', 0) djangocms version = '2.3.5' my fault. unicode error of "mypluginmodel" failed silently (why silently?)

c# - Using anonymus IEnumerable type -

this may simple question can not figure out... if have code, ienumerable myvar = (from in mylist select new { newtext= i.text, newvalue = i.value }); how can user values in myvar (without changing type( ienumerable ))? like foreach (var in myvar) { //i.... } edit : my actual code returns ienumerable public ienumerable getdata(ienumerable<int> pricedetailid) { .... return (from in mylist select new { newtext= i.text, newvalue = i.value }); } then need use result in loop.. var result = getdata(); foreach (var in result) { //i.... } you can't, because enumerator of ienumerable returns instances of type object . first need cast actual type. since type anonymous, can't that. change type of myvar var make work: var myvar = in mylist select new { ...

php preg_replace regex to replace function type string with its parameters -

i've text example. a quick brown fox sance("jumps") on lazy ok("good") dog. i want remove sance() above string inside text. output like a quick brown fox "jumps" on lazy ok("good") dog. i tried many regex remove sance() have no luck. of time replaces other ok("good") not acceptable. can plz me? try one: $string = 'a quick brown fox sance("jumps") on lazy ok("good") dog.'; echo preg_replace('/sance\((.*?)\)/', '$1', $string); output a quick brown fox "jumps" on lazy ok("good") dog.

python - remove scraped data with an empty value -

supposed scraping data , of fields scraped "" meaning no value , don't want row "" in it. how can it? example: field1 field2 field3 place blurred trying house fan door mouse hat what want program not write entire 2nd row csv because field3 empty. you can write , configure item pipeline following instructions [the scrapy docs] , drop item test on it's values. add in pipeline.py file: from scrapy.exceptions import dropitem class dropifemptyfieldpipeline(object): def process_item(self, item, spider): # test if "job_id" empty, # change to: # if not(item["job_id"]): if not(all(item.values())): raise dropitem() else: return item and set in settings.py (adapt projet's name) item_pipelines = [ 'myproject.pipeline.dropifemptyfieldpipeline', ] edit after op's comment testing ...

r - How to return neural network weights (parameters) values of nnetar function? -

i using nnetar of forecast package forecasting modelling of univariate time series. fitted model example neural network nar(p,p) on series data. want know how can return weighs or best weighs nnetar estimated?? that explained in ?nnetar : in output, model field contains list of neural networks fitted data (there several of them). library(forecast) fit <- nnetar(lynx) str(fit) str(fit$model[[1]]) summary( fit$model[[1]] ) # 8-4-1 network 41 weights # options - linear output units # b->h1 i1->h1 i2->h1 i3->h1 i4->h1 i5->h1 i6->h1 i7->h1 i8->h1 # 2.99 -7.31 3.90 -2.63 -1.48 4.30 2.57 2.77 -9.40 # b->h2 i1->h2 i2->h2 i3->h2 i4->h2 i5->h2 i6->h2 i7->h2 i8->h2 # -0.23 -1.42 -1.27 0.75 2.48 1.12 0.01 -2.79 -2.35 # b->h3 i1->h3 i2->h3 i3->h3 i4->h3 i5->h3 i6->h3 i7->h3 i8->h3 # 3.30 -1.43 -0.79 7.44 -0.42 1.12 -5.36 15.61 -5.17 # b->h4 i1->...

java - iBatis invoking a Stored Procedure with Oracle Type as parameters -

i using ibatis converse application. here's code: create or replace type typ_object object ( name varchar2(10), address varchar2(100), tel_no number ); create or replace procedure test_procedure ( in_oracle_type typ_object ) l_date date; begin null; // object end; i need invoke java class using ibatis. find no information online how achieve this. <procedure id="invokesp" parametermap="someinputmap"> {call test_procedure (?)} </procedure> <parametermap id="someinputmap"> // code goes here - what? </parametermap>

php - Displaying the image in other div - wordpress -

i want display image of posts in other div content's one. i mean this. <div class="latest-posts"> <div class="latest-posts-info"> <div class="title"><h1>here title<h1></div> <div class="text">here content</div> <a href="#" class="read-more">read more...</a> <div class="clear"></div> </div> <div class="latest-posts-img">here want image</div> <div class="clear"></div> </div> while adding post in wp admin, noticed way, displaying image in content. thanks check out page : http://codex.wordpress.org/function_reference/the_post_thumbnail <div class="latest-posts-img"> <?php the_post_thumbnail( $size, $attr ); ?> </div>

jquery - background for text area using HTML5 and CSS3 -

i placed background textarea borders black, changed border radius , did few other styling. end result shows line on top of customized text area , not sure how remove it. can please help? sure didn;t place line myself. css: #login { height:5%; font-family: arial, helvetica, sans-serif; font-size: 14px; color: black; position:absolute; padding-left:3%; left:0%; width:97%; height:32px; background: -moz-linear-gradient( top, #ffffff 0%, #ffffff 25%, #ffffff 50%, #ffffff 75%, #dadce8 ); background: -webkit-gradient( linear, left top, left bottom, from(#ffffff), color-stop(0.25, #ffffff), color-stop(0.50, #ffffff), color-stop(0.75, #ffffff), to(#dadce8) ); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; border: 1px solid #000000; -moz-box-shadow: 0px 3px 11px rgba(000,000,000,0.5), ...

javascript - Add hide parameter to script -

hi have following script , i'm trying add show , hide feature instead of having 1 hide , show it. "click me" shows , button hides it, fiddle example http://jsfiddle.net/9m99g/ $(document).ready(function () { var content = $('.below').hide(); $('.togglebtn').on('click', function () { $(this).next('.below').slidetoggle(); return false; }); }); just same .below div , slidetoggle $(this) : $('.below').on('click', function(){ $(this).slidetoggle(); }); demo jsfiddle see more slidetoggle()

mysql - Select pairs of values when searching a DB -

ina simple language translation table, want search lang1<=>lang2 pairs. in search form 3 fields available: 1. neutral text (entry name) 2. text in language1 3. text in language2 if field ommited, search should return everything, only if filled fields match . table looks this: id | neutral text | language | translation ---+--------------+----------+------------ 0 | submit | en | submit 1 | submit | cs | odeslat 2 | submit | fr | démarrer 3 | day | fr | jour 4 | monday | fr | lundi 5 | monday | cs | pondělí i find quite complicated find out, how return matching values, associate them pair language (in 1 query). tried make condition based on existence of other language: //executes if 1 language value specified select name, lang, content `texty` name $neutral_txt , (content $l1_val , lang=$l1 or lang=$lang2 , 0 < (select count(*) `texty` content $l1_val...

sql - Special superscript characters -

how insert string super script characters in postgresql? i want insert "tm" power of string "rach"? tried following query: update contact set name=e'rach$^'tm id='10782' i don't know if possible convert symbols supersripts without creating mapping function that, can write manually: update contact set name='rachᵀᴹ' id='10782' sql fiddle demo mapping function this: create or replace function superscript(data text) returns text $$ declare ss text[]; lt text[]; begin ss := '{ᴬ,ᴮ,ᴰ,ᴱ,ᴳ,ᴴ,ᴵ,ᴶ,ᴷ,ᴸ,ᴹ,ᴺ,ᴼ,ᴾ,ᴿ,ᵀ,ᵁ}'; lt := '{a,b,d,e,g,h,i,j,k,l,m,n,o,p,r,t,u}'; in 1..array_length(ss, 1) loop data := replace(data, lt[i], ss[i]); end loop; return data; end; $$ language plpgsql; sql fiddle demo

android - Volley does not call getParams for my custom request? -

please, volley automatically add params url? me it's not working , when looking sources, cant find call of getparams method.. should build url myself? it's no problem @ all, thought when there such method getparams, me:) update: below code.. public class bundlerequest extends com.android.volley.request<bundle>{ private string token; private onauthtokenvalidatorresponselistener mlistener; private final map<string, string> mparams = new hashmap<string, string>();; public bundlerequest(int method, string url, response.errorlistener listener) { super(method, url, listener); } public bundlerequest(int method, string url,onauthtokenvalidatorresponselistener providedlistener, response.errorlistener listener, string token) { super(method, url, listener); this.token = token; mlistener = providedlistener; mparams.put(authenticatorconfig.token_validation_paramname, token); } @overrid...

input - Jquery Duplicate complete table, changing attributes -

i got html table <table id="item-list" class="table table-hover table-striped"> <thead> <tr> <th>item</th> <th width="20%">nombre</th> <th width="20%">prix (ttc)</th> <th width="20%" class="actions">total</th> <th></th> </tr> </thead> <tbody> <tr class="order-item"> <td><input name="name[1]" type="hidden" class="m-wrap small refrech-calc" value="cardv2">cardv2</td> <td><input name="number[1]" type="text" class="m-wrap small refrech-calc" value="15"></td> <td><input name="price[1]" type="text" class="m-wrap small refrech-calc" val...

jquery - How do I stop a form from submitting? -

this question has answer here: stop form submitting , using jquery 4 answers how stop form submitting? have validation on form, , if the input isn't correct, form should't submit... in html have when clicking submit: <a href="#" onclick="settimeout(function(){document.getelementbyid('form_4').submit()}, 1000);" style="position:static" class="btn-more">vælg</a> and script looks this: $("#form_4 a.btn-more").click(function (e) { //validate required fields (i = 0; < required.length; i++) { var input = $('#' + required[i]); if ((input.val() == "") || (input.val() == emptyerror)) { input.addclass("needsfilled"); input.val(emptyerror); errornotice.fadein(750); e.stoppropagation(); ...

iphone - How can I implement login with email address or username using Parse.com? -

until have checked login credentials username , password using following syntax. loginwithusernameinbackground [pfuser loginwithusernameinbackground:[usernamefield.text lowercasestring] password:passwordfield.text block:^(pfuser* user, nserror* error){ but requirement that: user must need login 1 of both email , username . and need check username / email , password how can achieved? pfquery *query = [pfuser query]; [query wherekey:@"email" equalto:usernamefield.text]; [query findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error){ if (objects.count > 0) { pfobject *object = [objects objectatindex:0]; nsstring *username = [object objectforkey:@"username"]; [pfuser loginwithusernameinbackground:username password:passwordfield.text block:^(pfuser* user, nserror* error){ }]; }else{ [pfuser loginwithusernameinbackground: usernamefield.text passwo...

ios - Crash with "message sent to deallocated instance" when touching UITextField -

i have implementation of uiviewcontroller following code viewdidload : - (void)viewdidload { [super viewdidload]; // additional setup after loading view nib. (int i=0; i<10; i++) { nsuserdefaults *prefs = [nsuserdefaults standarduserdefaults]; nsstring *speeddial = [prefs stringforkey:[nsstring stringwithformat:@"%s%i", "fav",i]]; if ([speeddial length] > 0) [self gettextfield:i].text = speeddial; [self gettextfield:i].returnkeytype = uireturnkeydone; [self gettextfield:i].delegate = self; } } when touch uitextfield on screen app crashes , output: "message sent deallocated instance ". have same error when pressing button on view guess error @ uiviewcontroller level. using arc , uitextfield defined strong . have tried looking memory management issues no success. any idea? thanks, simon in [self.view addsubview:favorites.view]; using favorites view al...

ajax - HTML5 History API: go back and don't allow going forward (popState?) -

i have webpage shows user information. i'm using ajax allow user modify data without changing webpage. the structure simple: -when user goes profile can see data. -if user clicks edit button, form seen modify data. -if user sends form, data saved , static data shown again (updated). the user shouldn't able go edit page using back button. -if user clicks when editting, static data shown again. -if user clicks when seeing static data, should always go previous page (not profile). i'm using html5 history api handle back button clicks. i'm having problems when user submits data, since want him go previous state (not editing) without being able go forward. waht i'm doing right now: // edit button clicked. function edit1(){ history.pushstate("edit", null, ""); showform(); } window.addeventlistener("popstate", function(e) { var historystate = history.state; if(historystate == null){ showstaticd...

Java integer to byte -

i have following code: byte[] somearray; int a,b; . . . a=123; (result coming calculations, 0>=a<256) b=91; (result coming calculations, 0>=b<256) now want this somearray[0]=a; somearray[6]=b; however tried convert in byte failed (getting possible error messages think). tried various snippets referring integer byte conversion. so idea? update java.lang.numberformatexception: invalid int: "z" when try bytearray[0]=integer.valueof(string.valueof(bani.substring(2, 3)), 16).bytevalue(); integer -> byte conversion result in compilation error because might result in precision loss. documentation. however, can explicit cast: somearray[0]=(byte)a;

c++ - Why COM DLLs exports should be marked "PRIVATE"? -

when building com dlls, why should exports dllgetclassobject , dllcanunloadnow , dllregisterserver , dllunregisterserver , etc. marked private in exports section of associated .def file? when build dll, linker automatically creates import library dll. contains list of exported functions. use import library in project uses dll. specific com servers 4 exported functions found getprocaddress() , never have implicit dependency on com dll. create com objects cocreateinstance(), com plumbing takes care of locating dll , using getprocaddress() find dllgetclassobject() function. same story dllun/registerserver, found regsvr32.exe. , dllcanunloadnow, found com plumbing. therefore have no need import library. using private ensures function doesn't exported import library. of them private, no import library @ all. nothing goes wrong if omit it, file linker you'll never use.

cookies - Syntax PHP cURL HTTP Header to include variable -

below sample of code. need send field in header named "cookie" , it's value should have in $cookie variable. any chance tell me correct syntax in array include variable in there? $headers = array( "cookie:" .$cookie ); curl_setopt($ch, curlopt_httpheader, $headers); for example, first time "hit" server back cookie:jsessionid=280fc268ddba4260ab7f9a5c67304c5c if send server $headers = array( "cookie:jsessionid=280fc268ddba4260ab7f9a5c67304c5c", ); it won't respond new cookie. won't seem work when pass variable.

c# - trouble about working with material of model visual 3d? -

i made 3d box in code behind. i want color of material (for example, diffusematerial) in string format using raymeshgeometry3dhittestresult result1 in mouse left button down: geometrymodel3d result2 = result1.modelhit geometrymodel3d; i used: messagebox.show(result2.material.tostring()); this not work! thanks alot. if want color of brush used create diffusematerial string need first check if diffusematerial , not materials need work of brush , , have check if brush solidcolorbrush support single color. below should work: diffusematerial material = result2.material diffusematerial; if (material != null) { string brushcolor = null; var brush = material.brush solidcolorbrush; if (brush != null) brushcolor = brush.color.tostring(); }

python - Django admin inline conditional values -

i creating inline form in django admin suppose have conditional values. for example, have models class category (models.model): name = models.charfield(max_length=500) parent = models.foreignkey('self', blank=true, null=true, related_name='subcategory') def __unicode__(self): return self.name class business(models.model): category = models.foreignkey(category) name = models.charfield(max_length=500) def __unicode__(self): return self.name class descriptiontype (models.model): category = models.manytomanyfield(category) name = models.charfield(max_length=500) def __unicode__(self): return self.name class descriptions (models.model): descriptiontype = models.foreignkey(descriptiontype) business = models.foreignkey(business) so, have category ("restaurants"), , descriptiontype ("food speciality", belong "restaurants"). so want create business "foster ho...

encoding - Which 2d barcode has the highest data capacity/density -

;) if wanted encode 2mb of data onto 2d-bar code, 2-bar code starting point or recommend. there lots , different types of 2dbar codes out today,aztec 2-d barcodes,maxicodes,pdf417,microsoft hccb,vericodes....etc...lots.... unique in own way. i guess in nutshell questions is.... barcode make start off point encode 2mb of data?? i tried reading through qr code international standard turns out @ version 40l amount of data encode on qr code 1) numeric data: 7 089 characters 2) alphanumeric data: 4 296 characters 3) 8-bit byte data: 2 953 characters 4) kanji data: 1 817 characters which far cry 17million bits thats 2mb my goal create http://realestatemobilemarketingsolutions.com/wp-content/uploads/2012/07/real-estate-mobile-marketing.png after scan barcode can view photos of house/property on phone, dont have walk-in or wait open home,20 photos @ 100kb each 2mb even if create single 2d barcode encode whole thing, user won't able scan whole thin...

c# - deselect item in multiitem listbox with javascript -

i trying deselect item (once selected) when user click on item in listbox. have script deselecting item on user click happening when item selected first time well. have: js: function deselect() { var list = document.getelementbyid('<%=ddlcity.clientid%>'); var listlength = list.options.length; (var = 0; < listlength; i++) { if (list.options[i].selected) { list.selectedindex = -1; } } } and html: <asp:listbox id="ddlcity" cssclass="formfield" runat="server" datasourceid="sqldatasourcecity" datatextfield="description" datavaluefield="cityid" selectionmode="multiple" onclick="deselect();" ondatabound="dropdownlist3_databound"></asp:listbox> any idea how can edit js deselect value once value ...

c# - Unable to use JSON -

i have attempted use json.net, installed via nuget , tried include project using using statement. it's not showing in list of namespaces. i decided go asp.net web api libraries has json support. again tried include using using statement, no namespace. though it's installed. using system.json; also tired using system.net.json; i'm using c# 5 , .net 4.5. how can 1 of these packages work? stated both installed via nuget. there's no namespace them showing in intellisense. the namespace looking is: using newtonsoft.json;

c# - GetEnumerator: return or yield return -

my class implements ienumerable. , these 2 ways code getenumerator method can compiled: public ienumerator getenumerator() { yield return database[id].getenumerator(); } and public ienumerator getenumerator() { return database[databaseid].getenumerator(); } where database[id] list. difference between these implementations? the reason compiles because being unclear enumerable is. if make generic becomes more obvious: public ienumerator<foo> getenumerator() { return database[id].getenumerator(); } vs public ienumerator<ienumerator<foo>> getenumerator() { yield return database[id].getenumerator(); } your yield return version not yielding result: yielding the iterator - iterator-of-iterators, enumerator-of-enumerators. , not in way. basically, "don't that".

java - How to check (or even set) collation in mdb (ms access) file? -

i succesfully migrated access db mysql db. seems fine need more specific behaviour of mysql db. need same sorting of query result in access db after choose option "sort z" . use result in java application. mysql table utf-8 , collation set utf8_general_ci. example query is: "select encode, language suffixes order encode collate utf8_unicode_ci" it returns similar result there unacceptable differences in sorting. access sorts result this: 001_01._02.1_02.2.1_02.4_05.e.3.1_07.2.2_15.5.d_20.3.2.1_31.2.2_33.3.4_001 001_01._02.1_02.4.1_06.4.1_06.4.2_07.2.1.1_07.2.2_10.1_11.1.3_20.3.2.1_20.3.7_20.6.8_001 java sorts result this: 001_01._02.1_02.2.1_02.4_05.e.3.1_07.2.2_15.5.d_20.3.2.1_31.2.2_33.3.4_001 001_01._02.1_02.4_06.1_06.2.4.1.2_06.2.4.1.3_06.3.1_07.2.1.1_07.2.2.1_11.2.2_15.2.1.a.1_15.5.a_20.3.2.2.1.a_20.7.1.5_20.8_33.4.5.3_001 additionaly don't know how check charset , collati...

html - passing array to <option> with jQuery -

i'm making custom multiselect option box , need pass array of selected values element var data=[]; $(".opt > div").click(function(){ data[data.length]=$(this).attr("value"); $(".options").val(data); // putting data custom option }); html <div class="wrapper"> <!-- own custom style --> <select class="options"> <!-- select hidden css --> <!-- options --> </select> </div> <div class="opt"> <!-- div dynamically created clicking no class wrapper , populated inside select box's options jquery --> <div value="0">item 1</div> <div value="1">item 2</div> <div value="2">item 3</div> </div> everything going on click event want value .option class array 'data' , pass via it's form on submit request. how set array (data) it's value? like in check...

sql - Return date which I get as parameter in Stored Procedure -

this stored procedure connecting crystal report , want return start date , end date getting parameters if date null nothing shows on reports if date has value value prints. create procedure [dbo].patientclaiminfo @startdate date = null, @enddate date = null begin select p.vlname + ' ' + p.vfname patients_name, p.ipatid patient_id, p.ddob dob, d.ncopay, d.nvtotplan, d.nvwoplan, d.nvwopat, d.nvadjplan, d.nvadjpat, d.nvpaidplan, d.nvpaidpat, d.nvbalplan, d.nvbalpat, d.napptbal, d.vpaystat status pmvixtr d inner join pmptxft p on p.ipatid = d.ipatid @startdate <= d.dsdate , @enddate >= d.dsdate end in select statement can include @startdate, @enddate e.g. select @startdate, @enddate, .... <rest of select statement>... i suggest in clause use d.dsdate between(@startdate, @enddate) if don't want select if @startdate , @enddate null, having in clause can expensive... suggest have if condition if @startdate not null , @en...

mysql - CSV import via PHPMyAdmin, blank timestamp results in 0000-00-00 00:00:00 -

the destination table has column named updated , set as: name: updated type: timestamp attributes: on update current_timestamp null: no default: current_timestamp extra: on update current_timestamp the source data in csv, updated field blank every row, e.g. id,item_name,updated,quantity 1,car,,4 2,truck,,5 3,chair,,5 after importing using phpmyadmin, expect see updated column filled current date/time when import executed, however, 0000-00-00 00:00:00 instead. mysql version: 5.5.30. result same myisam , innodb. that because field supplied. supplied empty string, different null or default. empty strings converted 0 when cast numeric value. , timestamp 0 formatted date 0000-00-00 00:00:00 . you can either run update table set updated=now() after importing (if import complete set) or remove entire column csv.

c# - System.core dll can not be referenced -

i trying solve dlls reference problem in visual studio 2012. dlls have set them self in way looking .net 4.0 version while can not install because have .net 4.5 installed visual studio 2012.i have asked this question but didnt proper answer.now trying reference system.core in 4.5 can not referenced visual studio not allowing me do, says referenced automatically during project build not.i in catch 22 situation.kindly advise. have reinstalled visual studio 2012 didn't help. zara, i've looked @ download link provided , appears me it's windows8. windows7 , windows8 different in how handle things wouldn't dream of trying install such sdk on windows7 machine. my suggestion therefore try uninstall sdk , might work again. if sdk works windows8 there no use having installed on windows7 machine. windows7 @ keeping backups of files replaces when installing sdks , other things uninstalling sdk might restore before , might fine after that. if doesn't make di...

c# - Display 'Control Characters' on Button controls as its text -

i making virtual keyboard application in win forms, in have 150+ buttons. on these buttons, setting characters [like 'a','d','0','5','#','<' etc.] 'text' of buttons. here have done. if(keylbl.startswith("0x")) { // convert number expressed in base-16 integer. int value = convert.toint32(keylbl, 16); // char value corrospnding value, , set key label string btntext = char.convertfromutf32(value); } else... here keylbl getting string in hexadecimal representation [e.g 0x41, 0x42, 0x80, 0x81,... 0xff] now issue is, getting correct value in btntext values 0x7e not able text next strings 0x80 . how can symbols corresponding these display buttons' text.

mysql - database tables for each customer or database design with linked tables? -

i'm new (mysql) database design, , appreciate feedback respect following question. i'm developing website linked mysql database should contain customer info , product info. general customer info (name, address, date-of-birth etc) i've created table 'crm', general product info (description of products available) i've created table 'products'. my question how store list of products selected each customer? list of course vary per customer , can change on time. furthermore, table 'products' may alo change on time (new products being added or existing products being removed). first, though design 'customer product' table selected products each customer, after reading comments on related pages on site question whether that's design (as may result in on 100k tables). alternative solution may design single table 'customer products' using links this: table 'crm' table 'customer products' ...

php - Zend Framework 2 Routes not working -

so have new , fresh installation of zf2, works, except if create new controller... foocontroller.php , go application/foo 404 don't why, have setup routes, in zf1 worked out of box <?php /** * zend framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zendskeletonapplication canonical source repository * @copyright copyright (c) 2005-2013 zend technologies usa inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd new bsd license */ namespace application\controller; use zend\mvc\controller\abstractactioncontroller; use zend\view\model\viewmodel; class foocontroller extends abstractactioncontroller { public function indexaction() { $view = new viewmodel(array( 'foo' => 'the foo controller' )); return $view; } } yes need setup @ leaast 1 route. can setup generic route handle controller/action type routing: /** * generic route */ ...

android - How to compile FreeType2 for Tizen? -

i'm developing native tizen application requires freetype2 drawing fonts. i have searched documentation http://www.freetype.org , docs/ included in archive website, there no info on how with. i managed build static library android under ubuntu. works fine on android , figured use on tizen. although application compiles , ft_init_freetype( &library ) succeeds , crashes on ft_new_face or ft_new_memory_face . anyone has idea on how make static library tizen ? it turns out can use install.any docs make own project in tizen ide , build custom library compiled it.

php - How to post textbox value after selecting particular checkbox -

here snippet of html code..... 1)after checking each check box value's posting database. 2)but problem when checked other , need take value of text box , posting value of checkbox instead of textbox value but don't know did mistake... <form action="purchase.php" name="form1" id="form1" method="post"> <ul class="n_ul"> <span>*</span> primary goal? <br> <br> <li> <input name="goal" id="goal" value="add popular customer service attract/retain more customers" type="checkbox"> </li> <span>*</span> popular customer services <br> <br> <li> <input name="goal" id="goal" value="add turnkey revenue sources location(s)" type="checkbox"> </li...

Wcf WS-Security server -

i have created service such binding configuration: <bindings> <custombinding> <binding name="defaultbinding"> <textmessageencoding messageversion="soap12" /> <httptransport /> </binding> </custombinding> </bindings> and when service receives message starting this: <s:envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:header> <security s:mustunderstand="1" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <usernametoken> <username> </username> <password type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#passworddigest">...</password> <nonce encodingtype="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#base64binary">kwv...

c++ - Unknown Segmentation fault -

i getting segmentation fault when running following code: const int sensors = 65; static float coefficient[sensors][6]; const int numsubsystem = 6; const int allsensors = sensors * numsubsystem; using namespace std; int row = 0; static int outputerror = -1; //static retain value ifstream equationfile("equation.txt"); static string sensornameequation[allsensors]; static float coefficientoverride[allsensors][6]; //static keep large array off stack static string dependantsensor[allsensors]; //static keep large array off stack static float basetemp[allsensors]; //static keep large array off stack printf("total sensors: %d\n", allsensors); row = 0; if(equationfile) { while( equationfile >> sensornameequation[row] >> coefficientoverride[row][0] >> coefficientoverride[row][1] >> coefficientoverride[row][2] >> coefficientoverride[row][3] >> coefficient[row][4] >> oefficient[row][5] ...

java - Abstract class implementing an interface doesnt require method implementation. Why? -

i writing class going implement interface - interface has 1 method defined in it. when write class definition , write implements interfaceservice after class declaration , end definition , close brackets of class without overriding interface method.. compiles fine. there no compilation error , able save implementing class in eclipse. why so? shouldn't implementing class forced override method? here interface , implementing class definitions: interface: public interface interfaceservice{ list<map<string, object>> dosearch(searchvo formvo,string indexname,string type) throws searchexception; long gettotalhitcount(); } class: public abstract class clientflagsearch implements searchservice{ } i have feeling has defining implementing class abstract. why? shouldn't implementing class forced override method? no, abstract class not have implement every method of interface. methods choose not implement remain abstract , ha...

php - How to gradually output csv data as file download? -

i'm trying output large amount of data (about 13k rows) in csv format reading database. now problem server loses lot of time in fetching/parsing data phase , browser stuck until data collected , output browser file attachment. is there way force php gradually output data taken db browser emulating readfile() function behaviour? thank you you have use unbuffered query.

ios - Slide menu as facebook app -

i have found code slide de view , put viewcontroller don't wanna put viewcontroller, view need add slide menu in same viewcontroller. need add uiview in underleft slide. obs.: i'm not using storyboard on project. need add uiview in slidingview here code thats add viewcontroller: - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; // shadowpath, shadowoffset, , rotation handled ecslidingviewcontroller. // need set opacity, radius, , color. self.view.layer.shadowopacity = 0.75f; self.view.layer.shadowradius = 10.0f; self.view.layer.shadowcolor = [uicolor blackcolor].cgcolor; if (![self.slidingviewcontroller.underleftviewcontroller iskindofclass:[menuviewcontroller class]]) { self.slidingviewcontroller.underleftviewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:@"menu"]; } [self.view addgesturerecognizer:self.slidingviewcontroller.pangesture]; } i think using ecslidingviewcontrolle...

Set tck to vector of values in R -

i wanting set tick marks on x axis of plot change length (from 0.015 0.02) every 5th tick position, tck won't accept more 1 value, ideas? here example of code: year<-seq(1960,2010,1) xlab.pos <- rep (na, length (year)) xlab.pos [seq(1, length (xlab.pos), 5)] <- year [seq(1, length (year), 5)] xlab.tck <- rep(0.015, length (year)) xlab.tck [seq(1, length (xlab.tck), 5)] <- 0.02 plot(0, 0, type = "n", xlab = "", ylab = "", xaxt = "n", xlim = c(min(year), max(year)),ylim = c(0, 5000)) axis(1, @ = seq(min(year),max(year),1), labels = xlab.pos, tck = xlab.tck) but expected error: graphical parameter "tck" has wrong length can't figure out how set otherwise. using package hmisc out. library(hmisc) plot(0, 0, type = "n", xlab = "", ylab = "", xaxt = "n", xlim = c(min(year), max(year)),ylim = c(0, 5000)) axis(1, @ = seq(min(year),max(year),1), labels = x...

jquery - wait or sleep in javascript -

as can pause code of 1 second before running "post function". $(document).ready(function() { $("#button").click(function() { /*1 second pause before executing post */ $.post(url,{par1=5},function(e){ }); }); }); regards. you can use settimeout : $("#button").click(function() { settimeout(function() { /* 1 second pause before executing post */ $.post(url, { par1 = 5 }, function(e) { } ); }, 1000); }); also, assuming want multiple clicks of button send 1 request @ time, can use cleartimeout prevent site being flooded. try this var timeout; $("#button").click(function() { cleartimeout(timeout); timeout = settimeout(function() { $.post(url, { par1 = 5 }, function(e) { } ); }, 1000); });

sql - PHP - where clause equals 2 values grabbed from URL is not showing any results? -

i trying results specific race @ specific meet. raceresult.php?meet=<i>august meet</i>&race=<i>allowance fillies 2yo</i> the meet , race showing first query , of results show. example: this 1 works raceresult.php?meet=meet=2013 ojcr australian derby&race=allowance - 9f on turf 3yo does not work raceresult.php?meet=2009 gulfstream park grand opening meet&race=flying stakes - grade i, 3 yr old+, 8f on dirt are there characters causing error in second example? can go through , fix issue pretty i'm not sure keeping url working while other 1 works great. my code follows. <?php $sql = "select * racing `meet` = '$meet' limit 1"; $query = mysql_query($sql) or die( mysql_error() . "<br />" . $sql ); while($row = mysql_fetch_array($query)){ $date= $row['date']; echo "<h2><strong>$meet</strong> ($date)</h2>"; echo "<b>$race</b><...

Arbitrary object methods and properties in JavaScript -

i'm sure has definitively been answered before, , i've tried search it.. maybe search terms wrong... basically have object myobject , , have set of defined properties , methods it. want able handle calls/references properties , methods have not defined. for example, let's have this: var myobject = { someproperty : 'foobar', somefunction : function () { /* stuff */ } } currently, if tries make call myobject.someotherfunction() , javascript yells , screams it. want setup way automatically handle that. example, instead of javascript throwing error, object returns false. possible? another way @ this: var myobject = { somefunction : function () { /* stuff */ } magicbucket : function () { /* stuff */ } } if call myobject.somefunction() , defined , something. want happen if instance call myobject.someotherfunction() , instead of javascript throwing error, call myobject.magicbucket() . the reason have client uses third-party library on site. wan...

javascript - Vimeo default video size -

i trying embed number of different vimeo players, feature video content @ different resolutions. want dimensions of each player identical of it's respective video, no letter boxing / black border appears around edges. i'd have thought happen automatically, every player i've embedded defaults same size, regardless of dimensions of video. does know way either solve simply, or pull dimensions of video set player's height dynamically? i'm using iframe embed method. cheers when working different resolutions , browser sizes, best solution using javascript. here's jquery plugin called fitvids recommend. how use it: $(document).ready(function(){ // use div container contains videos $(document.body).fitvids(); });

tkinter - Set Python OptionMenu by index -

i'm trying set value in optionmenu index of options, , not use actual option value itself. for example, if optionmenu has options ["one", "two", "three"], want able set "one" writing my_option_menu.set(options[0]) , not my_option_menu.set("one") the optionmenu dynamically populated list depending on 2 other optionmenus set to, why want refer options index , not actual value. optionmenu object have way return list of options populated options[0] method above work? thanks. the simplest way keep copy of list used define optionmenu. can use index value list , assign associated variable. for example: options = ["one","two","three"] ... self.menuvar = tk.stringvar(master) self.optionmenu = tk.optionmenu(master, self.menuvar, *options) ... self.menuvar.set(options[0]) another option menu object associate widget, , use menu commands text @ given index, , use set variable: value = sel...

javascript - Form Validation with multiple DIVs showing by show/hide functionality -

i have multiple divs in page being shown 1 one using show/hide functionality. 2 divs contains form requires validation. in these divs not able use html 5 validation when click on submit button, particular div hides , next div shows. so basically, before next div appear, first div must show validations required. please find code mentioned below:- html div 1 form 1 <div id="step3content" role="step3locationinformation" class="marginleft nodisplay"> <form> <h1>location information</h1> <table width="80%" id="locinfo"> <colgroup> <col width="20%" /> <col /> </colgroup> <tr> <th>street #1</th> <td> <input type="text" name="lname" id="sadd1" required="required" />...

session - Cookie not being created and stored websphere -

i've web project deployed in 6.1 server creates , stores cookie session management. i've upgraded v7.0.0.27 , cookie not being stored nor created. i'm using jdk1.6_19, web module 2.5 , ejb 3.0. this way create cookie: cookie cookie = new cookie(user, divison); cookie.setmaxage(integer.max_value); cookie.setpath("/"); res.addcookie( cookie ); i've spent 2 weeks on nothing seems working. i've patched rsa have 7.5.5.5.001 fix, i've gone thru websphere console setting cookies, i've deployed same application in tomcat , cookie getting created in websphere v7.0.0.27 can't make it. any idea or solution issue appreciated i know question last year, had trouble last few days , found answer: websphere 7 has date format expire date (yy instead of yyyy). details, please have @ ticket . hope able help.

regex - Java Regexp pattern check -

Image
pattern ^\\d{1}-\\d{10}|\\d{1,9}|^twc([0-9){12})$ should validate of these 1-23232445 1-232323 1-009121212 12 12222 twc12222 twc1222324 when test twc pattern doesn't match, have added "|" consider or condition , have numbers 0-9 limiting 12 digits. missing ? twc([0-9) i think might not working?? you need twc([0-9]{12}) complete answer... (\d{1}-\d{1,12})|^twc(\d{1,12})$ even nicer answer .. ^(\\d-|twc|)(\\d{1,12})$ // syntax believe match needs. tested :) ^([0-9]-|twc|)([0-9]{1,12})$ // or ^(\d-|twc|)(\d{1,12})$ breakdown ^ this denotes start of string \d or [0-9] denotes 1 character of numbers 0 through 9 (note \d might not work in lanagues or require different syntax!) | is or {1,12} will accept particular pattern 1-12 times instance in code patternw ould \d or [0-9] $ is end of line this checks if line contains [0-9] - after,twc, or nothing space account nothing being there @ start reads 12 di...

java - How to save changes to @OneToOne relationship -

this part of eclipselink jpa entity: public class task implements serializable { @joincolumn(name = "idtransaction", referencedcolumnname = "serial_no") @onetoone(cascade = cascadetype.all) private transaction idtransaction; } when persist or merge task entity, transaction entity doesn't update changes it. somebody told me use : (cascade = cascadetype.all) didn't work. so, how can save changes both entites 1 persist/merge call ? i update database way: if (getentitymanager().isopen()) { gettransaction().begin(); entity = em.merge(entity); gettransaction().commit(); } "entity" task entity talking about, updates not relations. i found solution, these available cascades: cascadetype.merge cascadetype.persist cascadetype.detach cascadetype.remove cascadetype.refresh cascadetype.all if have entity "usa" list of "states" entites , made changes states have add...

VBA set charts on multiple sheets invisible Excel -

i have 9 different sheets, have 4 types of graphs (totals, comparison, bydate, trend). writing vba conditionally show 1 type of graph on every sheet. example, if want show totals graphs, want of sheets in workbook update. can make graphs go invisible , visible on 1 sheet, on sheets. here's code now: sub updategraph() sheets(".graphmanager").chartobjects("totals").visible = false end sub i want able on sheets tried this: sub updategraph() dim ws worksheet each ws in sheets if ws.visible ws.select (false) activeworksheet.chartobjects("totals").visible = false next end sub but no luck. not want manually type sheet names array because may add more sheets in future , don't want keep changing code. how can loop through sheets , set graph named "totals" invisible? or can set graphs in workbook named "totals" invisible without looping through sheets? thanks! you pass in parameter determines...

html - Apply styles based upon javascript condition -

i have 2 separate <style> tags both contain large number of styles , media queries. first set of styles applied desktop viewers, other set applied mobile viewers. when both sets of media queries run, messes display because different components visible @ different sizes. had been dynamically linking style sheets based upon user display, have been asked on 1 page no additional file loading. there way can apply 1 set of styles or other exclusively via javascript? you can mobile detection in javascript add class depending on styles want. ie. <body> <div class="mobile"> .. page .. </div> </body> or <body> <div class="desktop"> .. page .. </div> </body>

Odd error from ColdFusion when building a PDF with CFPDFFORM -

i have problem on 1 of 2 production systems. far have been able determine, both systems identical can make them, server 2 comes error: the web site accessing has experienced unexpected error. please contact website administrator. following information meant website developer debugging purposes. error occurred while processing request exception has occured in processing of pdf forms. '' error occurred in /opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm: line 1 called /opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm: line 1 called /opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm: line 1 called /opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/pdf.cfm: line 1 1 : <cfpdfform source="/opt/hrms/jboss-ewp-5.2/jboss-as-web/server/default/deploy/cfusion.war/test.pdf" action="populate"> 2 : <!---cfpdfformparam name=...