Posts

Showing posts from January, 2013

ibm mobilefirst - Error on real device . White screen and error:multiple define and script error on dojo.js -

worklight 5.06 , dojo 1.8. app works on android emulator , web browser doesn't works on real device. logcat: 08-08 14:58:35.520: d/dalvikvm(4470): gc_concurrent freed 437k, 8% free 6855k/7431k, paused 1ms+1ms 08-08 14:58:36.880: d/dalvikvm(4470): gc_concurrent freed 520k, 9% free 6851k/7495k, paused 1ms+2ms 08-08 14:58:37.330: d/dalvikvm(4470): gc_concurrent freed 381k, 9% free 6858k/7495k, paused 1ms+1ms 08-08 14:58:37.890: d/dalvikvm(4470): gc_concurrent freed 435k, 9% free 6856k/7495k, paused 1ms+1ms 08-08 14:58:38.530: d/dalvikvm(4470): gc_concurrent freed 404k, 9% free 6856k/7495k, paused 2ms+2ms 08-08 14:58:39.390: d/dalvikvm(4470): gc_concurrent freed 501k, 9% free 6861k/7495k, paused 1ms+2ms 08-08 14:58:39.870: d/dalvikvm(4470): gc_concurrent freed 504k, 9% free 6861k/7495k, paused 1ms+2ms 08-08 14:58:40.590: d/dalvikvm(4470): gc_concurrent freed 406k, 9% free 6869k/7495k, paused 2ms+2ms 08-08 14:58:40.630: d/dalvikvm(4470): gc_concurrent freed 523k, 9% free 6855k

Access Matlab classes in MEX/C-code -

i have rewrite matlab code c embedded matlab using mex once again. far, i've read tutorials , examples in how works simple data structures. (i've never done before, though consider myself experienced in both matlab , c). so here problem: i have given that classdef myclass properties foo; bar; blub; somethingelse; end methods function obj = myfun(obj) % random example code obj.foo = obj.bar; obj.blub = 42; = 1:length(obj.somethingelse) obj.somethingelse(i) = i*i; end; end end end i want rewrite myfun mex/c-function. if pass class mex-function, how can access different properties of class? thanks you have following functions in mex api: mxgetproperty , mxsetproperty their use equivalent to: value = pa[index].propname; pa[index].propname = value; note these functions create deep copies

ANDed-ORed query in django -

i want execute following query in django filters out model based on both anded , ored states collectively. the query in sql this: select * webreply (conversation_id = conversation_id , (user_id = ids or sent_to = ids)) this wrote in django, throws error saying non-keyword arg after keyword arg django web_reply_data = webreply.objects.filter(conversation_id = conversation_id, (q(user_id = ids) | q(sent_to = ids))) where going wrong? try this: web_reply_data = webreply.objects.filter(conversation_id = conversation_id).filter( q(user_id = ids) | q(sent_to = ids))

php - SQL - Count how many itmes in a GROUP also using SUM -

i'm using pdo (still learning) , have current sql query. works perfectly, merging duplicate entries , adding value. there way see how many duplicate entries there were? $sql = "select col1, sum(col2) table date > :fromdate , date < :enddate group col1"; my table looks this col1 col2 ----- ------ abc 2 aba 3 add 1 aed 3 abc 2 aba 3 add 1 aed 3 aed 0 at moment, after loop through, result looks this col1 col2 ---- ---- abc 4 aba 6 add 2 aed 6 but i'd value of how many times occured in db before grouped end with col1 col2 times appeared ---- ---- -------------- abc 4 2 aba 6 2 add 2 2 aed 6 3 use count() that. counts records in group if used group by select col1, sum(col2), count(*) 'times appeared' table date > :fromdate , date < :enddate group col1

wpf - TextBlock and TextBox objects alignment depending on width of border container -

what have when size of border container wide enough: textblock textbox textblock textbox then size of border gets smaller , have this: textblock textbox textblock tex there not enough space fourth textbox need this: textblock textbox textblock textbox how can achieve it? wrappanel + container around units.

c# - Add and remove CssClass ASP.NET -

i have weird behavior asp.net application. want change color of current selected row in grid view. my gridview defined : <asp:gridview [..] onselectedindexchanged="supresultlist_selectedindexchanged"> [..] <rowstyle cssclass="datagriditem" /> <alternatingrowstyle cssclass="datagridalternateitem" /> </asp:gridview> in code-behind, have : protected void supresultlist_selectedindexchanged(object sender, eventargs e) { gridview grid = sender gridview; // remove class "selected" older row foreach (gridviewrow row in grid.rows) { row.cssclass = row.cssclass.replace("adminrowselected", string.empty); } grid.selectedrow.cssclass = string.join(" ", grid.selectedrow.cssclass, "adminrowselected"); } may there better way want ? anyway, when gridview first rendered, rows have classes. when select row , enter in supresultlist_selectedindexchanged

php - Integrity constraint violation: 1062 Duplicate entry '4974-134' for key 'UNQ_CATALOG_PRODUCT_SUPER_ATTRIBUTE_PRODUCT_ID_ATTRIBUTE_ID' -

Image
i getting above error in magento when adding configurable product (before creating simple products) this has worked reason failing. the key value 4974-134 doesn't exist in table: i've tried re-creating table. i''ve cleare cache/log tables/re-indexed , nothing seems work - each time 4974 (product/entity_id) increments 1 implying being created in catalog_product_entity table isn't: the way resolve extend/overwrite product model _aftersave function in new module (make sure new class extends extends mage_catalog_model_product ). like so: /** * saving product type related data , init index * * @return mage_catalog_model_product */ protected function _aftersave() { $this->getlinkinstance()->saveproductrelations($this); if($this->gettypeid() !== 'configurable') { $this->gettypeinstance(true)->save($this); } /** * product options */ $this->getoptioninstance()->setproduct(

vba - Access2010: Opening screen to display animation while linking tables -

when access 2010 application loads, need link couple oracle tables security reasons before show logon screen. show animated gif if possible while tables being linked in background. have created form has animated gif webbrowser control. when screen opens, animated gif works great. thought open form , call animated gif form me.repaint doevents and subroutine linktables, after wish close both forms. the animated gif form opens, shows frozen image, links , closes. is there anyway show animation while occuring in background? multithreading in access isn't possible can similiar: split animated gif series of still images can viewed sequentially: a,b,c, etc. split background process series of tasks: 1,2,3 etc. make loading form. show image a. when background process finishes task 1, replace image b. when background process finishes task 2, replace image b c. repeat. does make sense?

c++ - deque vs vector guidance after C++11 enhancements -

this question has answer here: how can efficiently select standard library container in c++11? 4 answers back in pre-c++11 days, many book authors recommended use of deque situations called dynamically sized container random access. in part due fact deque move versatile data structure vector , due fact vector in pre-c++11 world did not offer convenient way size down capacity via "shrink fit." greater deque overhead of indirect access elements via brackets operator , iterators seemed subsumed greater vector overhead of reallocation. on other hand, things haven't changed. vector still uses geometric (i.e., size*factor) scheme reallocation , stil must copy (or move if possible) of elements newly allocated space. still same old vector regard insertion/removal of elements @ front and/or middle. on other hand, offers better locality of reference, alt

c# - Handling WCF Rest Service exceptions only in one place -

i'm developing wcf rest service i'm going host on iis. now i'm implementing service contract, , see i'm repeating same code on of methods when i'm trying handle exceptions. this 1 of service contract method: public void deletemessage(string message_id) { int messageid; outgoingwebresponsecontext ctx = weboperationcontext.current.outgoingresponse; if ((message_id == null) || (!int32.tryparse(message_id, out messageid)) || (messageid < 1)) { ctx.statuscode = system.net.httpstatuscode.badrequest; ctx.statusdescription = "message_id parameter not valid"; throw new argumentexception("deletemessage: message_id not valid", "message_id"); } try { using (var context = new adnlinecontext()) { message message = new message() { messageid = messageid }; context.entry(message).state = entitystate.deleted; context.savechanges

php - How to add a product category in woocommerce wordpress -

i hope can me problem asap. ok building costum script users publish new product, have working , inserting (event photo) cant seem find anywhere code should used update post category, not normal category because has taxonomy of "product_cat" (woocommerce product category). any ideas? non of following work: ($term_id term_id relates "product_cat" of product) wp_set_post_terms($post_id, array($term_id), "product_cat"); wp_set_post_terms($post_id, (int)$term_id, "product_cat"); update_post_meta($post_id,'product_cat',$term_id); i have tried others dont seem @ all, functions create new category id... well test wp_set_post_terms($post_id, array($term_id), "product_cat"); , worked me.

css - background-color on specific div appearing on whole page -

i'm working on page: http://broadcasted.tv/ my headings have following (i know should class, doing testing) #title-container { background-color: #333; color: #fff; margin-top: 15px; } it works fine everywhere except there http://broadcasted.tv/user/2/albertmarch/ and can't figure out why heading whole page... missing div ?? any appreciated thanks! the background goes away if add clear: #title-container { background-color: #333; color: #fff; clear: both; margin-top: 15px; }

c - Storing Pointers difference in integers? -

this code: #include<stdio.h> #include<conio.h> int main() { int *p1,*p2; int m=2,n=3; m=p2-p1; printf("\np2=%u",p2); printf("\np1=%u",p1); printf("\nm=%d",m); getch(); return 0; } this gives output as: p2= 2686792 p1= 1993645620 m= -497739707 i have 2 doubts code , output: since 'm' int, shouldn't take p2-p1 input since p1 , p2 both pointers , m integer should give error "invalid conversion 'int' 'int' " isn't. why? even after takes input, difference isn't valid. why it? since 'm' int, shouldn't take p2-p1 input since p1 , p2 both pointers , m integer should give error "invalid conversion 'int' 'int' " isn't. why? this type of error or warning depends on compiler using. c compilers times give programmers plenty of rope hang with... even after takes input, difference isn'

datetime - PHP Sorting files by Date/time and file size -

i working on modifying simple website. website has page shows clients files available download(if applicable). @ moment these files in random order no specific details. able have them in decending order based on time stamp made available. including file size. using php show files, need have directory sorted before displaying them? if separate script , when run? or can sort them displayed in follwoing code? <div id="f2"> <h3>files available download</h3> <p> <?php // list contents of user directory if (file_exists($user_directory)) { if ($handle = opendir($user_directory)) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { echo "<a href='download_file.php?filename=".urlencode($entry)."'>".$entry."</a><br/>"; } } closedir($handle); } } ?> </p>

css - how should I change the sequence of a list -

this code creates list of year + month var currentdate = datetime.now; var list = new list<archiveviewmodel>(); (var startdate = currentdate; startdate >= new datetime(2012, 8, 1); startdate = startdate.addmonths(-1)) { list.add(new archiveviewmodel { month = startdate.month, year = startdate.year, formatteddate = startdate.tostring("mmmm, yyyy") }); } return partialview("_archivesidebar", list); and code in razor @foreach (var archive in model) { <ul> <li> @html.actionlink(archive.formatteddate, "post", "archive", new { year = archive.year, month = archive.month }, null) </li> </ul> } in case result august, 2013 july, 2013 june, 2013 may, 2013 april

Is there a way to run a command on a different git branch? -

i have large rails project several feature branches active @ 1 time. have long running task (rebuild db, run tests). i able run test task on 1 feature branch while changing code on another. there way run particular command on branch, have branch active in terminal? some git commands can operate on reference, doesn't have branch checked out working copy: git log <branch> git diff <branch-one> <branch-two> other git commands operate on branch have checked out in working copy: git reset --hard head@{1} if tests depend on there being branch checked out working copy, far know, can't have more 1 branch checked out working copy, can have 1 working copy. as alternative, possibly clone local repo again second working copy way: git clone <path local repo> second-repo

active directory - Accessing ActiveDirectory properties belong to objectClass=posixGroup -

i trying update memberuid property of posixgroup . i directory search , find record. if loop through searchresults.property can list values (it defined multi-value) of field. i define directoryentry using searchresults.getdirectory method. if property directoryentry , instance check if exists ( property.contain ), or list or try update unknown error x'8000500c' . the fields cn , description ' not cause problem. if add other user defined properties error. how can work properties belonging type of schema? your error looks is: 8000500c active directory datatype cannot converted to/from native ds datatype this seems imply data returned not native ad datatype. there seems workaround @ article.

android - "onClick" in AutocompleteTextView causes an error -

i have autocompletetextview. want method run "onclick". here xml: <autocompletetextview android:id="@+id/givenbybox" android:layout_width="fill_parent" android:layout_height="wrap_content" android:onclick="setupmiranda" android:gravity="left" /> when run, errors. doesn't matter onclick set to, cause error. if remove android:onclick line works fine, not want. here excerpt logcat: 08-07 13:56:36.040: e/androidruntime(32735): fatal exception: main 08-07 13:56:36.040: e/androidruntime(32735): java.lang.runtimeexception: unable start activity componentinfo{com.itsmr.dre_android_clean/com.itsmr.dre_android_clean.mainactivity}: android.view.inflateexception: binary xml file line #46: error inflating class <unknown> 08-07 13:56:36.040: e/androidruntime(32735): @ android.app.activitythread.performlaunchactivity(activitythr

php - Datamapper and CI: is not a valid parent relationship -

i have 2 models tables need relate, campus: class campus extends datamapper { var $table='campi'; var $has_many=array('boleto'); function __construct() { parent::__construct(); } } and boleto: class boleto extends datamapper { var $table='boletos'; var $has_one=array('campus'); function __construct(){ parent::__construct(); } } i have been working these tables 5 months, have relation table: | id | boleto_id | campus_id | everything ok, recently, every time need make includes relation got error message: datamapper error: 'boleto' not valid parent relationship campus. relationships configured correctly? do know what's happening? can't find error. strange that, said, working. thanks in advance! table boletos : | id | folio | table campi : | id | nombre_campus | table boletos_campi : | id | boleto_id | campus_id | i'm trying code (as wo

Powershell array values, concatenating data -

this kind of painful question ask, here goes. i'm creating powershell script report on filer shares on netapp. i've gotten point can create report of shares, want take array i've created csv output , extract sharename value. want append in front of value servername "\filer\" creates unc path. i'm intending @ unc , use generate information on filer shares. ntfs permissions, path info, etc etc.. here's code: $sharelist = import-csv z:\shares.csv foreach ($item in $sharelist) { $sharelist += $item | add-member -name "filer" -value "\\<filername>\" -membertype noteproperty } this creating array , adding new property array match unc info... i run select object clean output: $sharelist | select-object mountpoint,filer,sharename,description | export-csv z:\sharereport.csv -notypeinformation this produces new csv that's nice , organized when open in excel. however want take objects "filer" , "sha

java - Reversing a String using a for loop -

this question has answer here: reverse string in java 33 answers i want reverse inputted string using loop. have tried following code below. [ full of mistake think.. cause dont know how convert things array or string in problem ]. please me coding here... public class main extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); textview tv = (textview) findviewbyid(r.id.textview1); edittext input_string =(edittext) findviewbyid(r.id.edittext1); final string orig = input_string.gettext().tostring(); button rev = (button) findviewbyid(r.id.button1); rev.setonclicklistener(new onclicklistener() { @override public void onclick(view arg0) { int limit = orig.length();

Ruby empty parameter in function -

i'm trying enqueue various functions in generic way code : { object.const_get(object_name).new(job[:params]||={}).delay(:queue => queue).send(method_name)} job hash name, objects parameters etc... my problem in case : class foo def initialize puts 'bar' end end foo doesn't take parameters instanciation. so if use previous line foo object_name i'll error : argumenterror: wrong number pf arguments (1 0) and absolutly don't want write : if job.has_key?[:param] object.const_get(object_name).new(job[:params]||={}).delay(:queue => queue).send(method_name) else object.const_get(object_name).new().delay(:queue => queue).send(method_name) end what write instead of job[:params]||={} works every case? thanks in advance. you can achieve using foo.send , using array. for instance object. const_get(object_name). send(*(job.has_key?(:param) ? ['new', job[:param]] : ['new']))... i think not w

asynchronous - Async Server handling many clients and messages in C# -

i create server handles multiple clients , handles them in async fashion. based on link below created code : http://msdn.microsoft.com/en-us/library/w89fhyex.aspx after inspection of msdn code realized manual event code blocking. my query solution if server designed accept many connections many clients won't making thread wait until connectcallback tells it finished cause potential connecting clients connecting @ time of waiting timeout or drop?

How do i put a word filter on my website chat? -

i want put filter on chatroom of website filter words (eg: if types 'hello' filtered 'heey')...that's example. how go doing that? that depend on language have coded chatroom in. assuming php, read text , str_replace() function. for more info, http://php.net/manual/en/function.str-replace.php

python - django objects.filter exclude yourself -

handling uniqueness in code in django, i've found problem: how check records @ validators, excluding yourself, because update function? i've trying below, doesn't works. please, me? model.py def check_email_person(email_given): myid = person.id if person.objects.filter(email=email_given).exclude(id__in=myid): raise validationerror(u"e-mail exists!") class person(models.model): email = models.emailfield(blank=true, null=true, validators=[check_email_person]) you should in form validation: def clean_email(self): email = self.cleaned_data["email"] try: user.objects.get(email=email) except user.doesnotexist: return email raise forms.validationerror('duplicate_email')

signing - Cannot sign blackberry 10 app -

i'm trying sign bb 10 app hidden home screen (ie there no icon on home screen launch app). i following error when try sign. error: code signing request failed because [hidden] in entry-point-system-actions not allowed. are there sort of special permissions needed make app hidden? hidden apps not permitted on blackberry 10. there ability run app in background, while app not open in next few months, there no plans allow apps don't have presence on users home screen. http://crackberry.com/going-headless-background-app-support-coming-soon-blackberry-10

web applications - On file reader's call back change corresponding input elements scope's property? -

with reference question file pick angular js , on file reader's on load want modify parent scope's property. consider $scope.fileloaded = false; //initially $scope.file_changed = function(element, $scope) { $scope.$apply(function(scope) { var photofile = element.files[0]; var reader = new filereader(); reader.onload = function(e) { $scope.fileloaded = true; // intend do! ... }; reader.readasdataurl(photofile); }); }); how achieve html: <input ng-model="photo" onchange="angular.element(this).scope().file_changed(this)" type="file" accept="image/*" /> it fails every time error cannot set property 'fileloaded' of undefined. couple of things. use ng-change instead of onchange. do in directive. don't want accessing elements in controller. can two-way bind fileloaded in directive can access in controller if you'd to, or can encapsulate functiona

JIRA Gadget Plugin with HighCharts -

i'm trying create jira gadget uses highcharts , i'm not being able call in javascript highcharts.js correctly. the file located at: atlassian_tutorial-jira-gadget/src/main/resources/js/highstock/highcharts.js the atlassian-plugin.xml has following added it: <web-resource key="highstock"> <resource type="download" name = "highcharts.js" location = "js/highstock/highcharts.js"> <property key = 'content-type' value = 'text/javascript' /> </resource> </web-resource> the gadget file gadget.xml has following: #requireresource("plugin-key:highstock") ... <div id = "container">highstock</div> ... ajs.$('#container').highcharts('stockchart',{title:{text:'test'}}); nothing happens @ all. , following error in google chrome console: uncaught typeerror: object [object object] has no method 'highcharts'

javascript - How to put nested php array into java script? -

i have code $ref = addslashes(htmlspecialchars(json_encode($value))); echo '<script>var message_store_'.$key.'=$.parsejson('.$ref.');alert(message_store_'.$key.');</script>'; echo '<div class="message_entry" id ="message_entry'.$key.'" onclick="open_up_thread(\''.$ref.'\',\''.$key.'\');">'.$key.'</div>'; $recent = end($value); echo '<div id ="recent_message_log_entry'.$key.'"><div>'.$recent['message'].'</div><div>'.$recent['date_posted'].'</div></div>'; i facing problem storing array in global javascript variable. have div onclick event working fine array got converted wanted , function open_up_thread parsing encoded json object fine. i need keep track of array before onclick event fired(after onclick eas

vba - How do I create a textbox in excel that fills a specific range? -

using vba, i'd able add , make sit on specific range, a2:h8 , example. possible? i know alternatively merge bunch of cells , make text box way, hoping easier user move around if they'd to. right i'm using generic add function, , trying in area want be. however, entire page going change due user input, depending on do, i'll need in different place. if tied specific range, in perfect place, no matter user does. here's current little code snippet: sub macro1() activesheet.shapes.addtextbox(msotextorientationhorizontal, 153.75, 88.5, 509.25, 272.25).select selection.shaperange(1).textframe2.textrange.characters.text = "hello hello hello" & chr(13) & "" & chr(13) & "hello" & chr(13) & "hi" & chr(13) & "" & chr(13) & "hello" selection.shaperange(1).textframe2.textrange.characters(1, 18).paragraphformat.firstlineindent = 0 selection.shaperange(

php - fetch data from multiple tables -

i have 4 table ads portal. firstly main table name ads +-------------+ | field + +-------------+ | id + | ads_title + +-------------+ example data ads table; +----+-----------------+ | id | ads_title | +----+-----------------+ | 20 | 2006 citroen c4 | | 27 | emekli ogretmen | | 28 | harika 10 n | | 34 | hatasiz boyasiz | | 49 | bayandan 2009 | +----+-----------------+ for ads specifications stored in table. table name ads_spc +---------+ | field | +---------+ | id | | key_name| +---------+ data example ads_spc table; +----+-------------+ | id | key_name | +----+-------------+ | 1 | date | | 2 | km | | 3 | colr | | 4 | engine | | 5 | pw. engine | | 6 | oil | | 7 | speed | | 8 | boody type | | 9 | traction | | 10 | warranty | +----+-------------+ lastly stored specification values ads_spc ads_id. table name ads_values +------------+ | field | +------------+ | id

python - creating a new filesystem call for FUSE filesystem -

implementing filesystem using python fuse library. have implemented "snapshot" feature (api) file system. want call snapshotting api, via system call (ls,mkdir,etc) - snapshot? how create new system call? unfortunately, can't add system call fuse, since fuse relies on kernel heavy lifting of syscalls. you'll need add kernel. on other hand, sure need full blown system call, or can implement need @ user level? (for instance, ls , i.e. readdir() not system call, it's user level library routine calls other system calls, getdents() .) if need make call available programs running on system, add 1 of standard libraries, or hack in using ld_preload . for adding system calls kernel, see here: http://www.csee.umbc.edu/courses/undergraduate/cmsc421/fall02/burt/projects/howto_add_systemcall.html for ld_preload approach, see here: what ld_preload trick?

actor - What other stuff can a Scala message tell you? -

given scala code below: actor1 actor2 ! 'some_message actor2 receive (or react) { case 'some_message sender ! 'ok_message what info sender (actor1) can actor2 ? how can tell actor message came if more 1 actor can send same message actor2 ? there metadata in sender can queried ? am newcomer scala. patience. ...ken r you can send actor sent original message part of message. actor1 actor2 ! ("message", self) actor2 receive (or react) { case (string: string, sender: actor) => { sender ! "another message" } } it should noted, though, should use send message original sender. calling function directly on actor cause sorts of terrible things happen! i read in programming in scala today, if want more it, highly recommend book.

c# - Microsoft.VisualStudio.TestTools.WebStress.WebTestSuite -

i looking object: microsoft.visualstudio.testtools.webstress.webtestsuite i can't seem find anywhere. i working in vs2012 sdk , know object exist because used internally. i have looked on web information on this, there none. thanks ahead.

add on - Sony Add-On SDK for Android 4.2.2+? -

just upgraded xperia z android jelly bean 4.2.2 : i curious know if there sony sdk support android 4.2.2 (api17) or 4.3 (api18) or if support limited 4.1.2 (api16) xperia shipped? basically, i'm doing bit of dev through eclipse , see sdk entry in api16. i've upgraded i'm worrying i'll see problems. question : so, in android sdk, can enter sony sdk in api17/api18 or need wait sony update sdk? (i have had look, don't know if sony slow @ or if i'm missing in process; sony sdk instructions api16 , entry appears in api16 in android sdk manager) the current sony add-on sdk supports api level 16 have noted. need wait update if want use new features of api 17 or 18. kind of problems worried about? phone should still backwards compatible previous api levels long set android:targetsdkversion="16" in androidmanifest.xml app should run without issues.

struts 1 - hibernate strut1 action is not executing -

the action register.jsp not executing though described in struts-config.xml. have login.jsp page working well. register.jsp not throwing error doesnt execute. please take @ code. thanks register.jsp <%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%> <%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> </head> <body> <h1>register</h1> <html:form action="register"> <bean:message key="label.username" /> <html:text property="username"></html:text> <html:errors property="username" /> <br/> <bean:message key="label.name"/>

database - Should I be storing this information as the attribute of an entity and then retrieve it? Or simply query it with instances of association? -

structure of database problem: tv_shows tv_show_id, tv_show_title, tv_show_description, network, status episodes episode_id, tv_show_id, episode_title, episode_description, air_date hi, i unsure of what’s best here. output number of episodes of tv_show1, should make attribute of tv_shows table , include it? (i.e. “”no_of_episodes”) or count number of episodes there’s occurrence of id tv_show1 in episodes table query? that’s not all...something else riddling me task. if wanted premiere date of tv_show1, make attribute in tv_shows table? or retrieve querying earliest instance of episode’s air_date? both solutions work have no idea what's correct the basic rule of thumb in database design: only store each piece of information in 1 place. while system might run faster if store each count, have adjust counts each time add or remove episode. consequently, it's better count records each time query.

How to make my vine video with sound not muted at the start -

is there way in script unmute video? need click sound button have sound: iframe class="vine-embed" src="https://vine.co/v//embed/simple" width="600" height="600" frameborder="0"script async src="//platform.vine.co/static/scripts/embed.js" charset="utf-8" or can make own embed.js , make sound come out @ same time video , point @ domain instead of vine? thank's infos use below "audio=1" <iframe class="vine-embed" src="https://vine.co/v/h0xhmmx1nzh/embed/simple?audio=1" width="480" height="480" frameborder="0"></iframe><script async src="//platform.vine.co/static/scripts/embed.js" charset="utf-8"></script>

gmail - Unable to load BODYSTRUCTURE exception with an email containing an .eml file sent using Thunderbird -

we have application accesses gmail account (imap) using java mail api. works fine types of emails except message contains .eml file attachment , message sent using thunderbird. here exception stack trace when trying retrieve message . please advise. caused by: com.google.code.javax.mail.messagingexception: unable load bodystructure @ com.google.code.com.sun.mail.imap.imapmessage.loadbodystructure(imapmessage.java:1377) @ com.google.code.com.sun.mail.imap.imapmessage.getcontenttype(imapmessage.java:492) what version of javamail using? you might running 1 of gmail bugs described here .

android - Hello World, most basic of setup errors -

all trying setup simple android "hello world" example, have made no alteration java code or xml layout (none xml @ in fact) beyond has been prescribed through searching stackoverflow remedy problems experiencing: scr folder errors, "r cannot resolved variable." i have followed advice import mypackage.r rather android.r , clean project, rebuild it, restart eclipse after clean, , related can find... when follow advice clean project eclipse erases "import local.example.project1.r" , resets "android.r" or removes import... i'm throwing errors in simplest example of "hello world," should go right out of box , cannot find resonable explanation why... what missing? if helps figure out problem notice gen folder not contain anything, though indications should contain autogenerated java file.... package local.example.project1; import local.example.project1.r; import android.app.activity; import android.os.bundle; import and

Excel VBA Compile Error -

we have excel spread sheet use , works machines bombs out 'compile error in hidden module - general' on others, , reason appears due missing references. we check macros enabled still doesn't help. since protect excel spread sheet password, don't want giving password out our users check references, , wondered if had idea how can add vba code check whether references required excel spread sheet there , if not bring message box advise user. the references use follows: visual basic applications microsoft excel 11.0 object library microsoft forms 2.0 object library microsoft windows common controls 5.0 (sp2) alternatively, if has other suggestions on how go problem, great. the reference have listed possibly missing common controls. rest default in every version of excel. forms 1 if have userform or explicitly set it, that's not problem. common controls problem. doesn't ship office anymore. if have visual studio or vb6 have it. or old versi

Python software development (CSV to Pandas to SQL or CSV to SQL to Pandas) -

i have multiple csv files want manipulate(calculate mean, sum, etc.) , after want store them in sqlite database. but want know proper way that. csv sql , manipulate pandas or csv, manipulate pandas , store in sql for example, want store data in table http://financials.morningstar.com/ratios/r.html?t=goog&region=usa&culture=en-us . update yearly , add 2013,2014,etc. in sql table. i'll create column have 10 year average each rows, etc. regards, right now, pandas's support manipulating csv files far beyond of ability manipulate sql databases, though there significant effort right improve latter leaps , bounds! take @ the read_csv docs . 1 of flexible, fast, , powerful text file readers/writers out there data analysis applications. on other hand read_sql can write sqlite databases , doesn't store index . with read_csv can read multiindex objects (hierarchical indexes)! if aren't tied database, recommend using pandas hdf5 persis

c++ - undefined reference to vtable for DownloadManager -

i trying integrate working code program, receive error displayed on title while compiling. here code: /**************************************************************************** ** ** copyright (c) 2013 digia plc and/or subsidiary(-ies). ** contact: http://www.qt-project.org/legal ** ** file part of examples of qt toolkit. ** ****************************************************************************/ #include <qcoreapplication> #include <qfile> #include <qfileinfo> #include <qlist> #include <qnetworkaccessmanager> #include <qnetworkrequest> #include <qnetworkreply> #include <qsslerror> #include <qstringlist> #include <qtimer> #include <qurl> #include <stdio.h> qt_begin_namespace class qsslerror; qt_end_namespace qt_use_namespace class downloadmanager: public qobject { q_object qnetworkaccessmanager manager; qlist<qnetworkreply *> currentdownloads; public: downloadmanager();

c# - Generate gif/png image with MVC based on other png? -

i've been looking way generate text on top of png using asp.net. know how enter url , generate image content on using no extension like: midomain.com/application/?text=hello, , see on sreen image says hello on it. know possible animated gifs, example: https://www.onnit.com/emails/_modules/timer/?end=2013-12-27+00:00:00&dark=0 and know how php post: http://seanja.com/secret/countdown/ but know how mvc, , far have no idea on start. advice appreciated.

ruby on rails - RoR: rendering devise login into application layout -

i'm trying render devise sign in page "devise/sessions/new" application layout, i'm wondering how so? if this: <%= render "devise/sessions/new" %> i error: actionview::missingtemplate in static#index missing partial devise/sessions/new {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. searched in: if try this: <%= render :template => "devise/sessions/new" %> i error: nameerror in users#show undefined local variable or method `resource' where have form: <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) |f| %> i'm trying bring sign in form application layout, if possible. whats name have used sign in page. if - "new.html.erb", rename "_new.html.erb". then, <%= render "devise/sessions/new" %> will work. for second issue, coming again after above thing. nameerror in users#sho

java - Dividing long by long returns 0 -

this question has answer here: is “long x = 1/2” equal 1 or 0, , why? [duplicate] 6 answers i trying calculate % of used diskspace in windows , totaldrive denotes total diskspace of c drive in long , freedrive dentoes free space in long. long totaloccupied = totaldrive - freedrive; here calculating % of usage long percentageused =(totaloccupied/totaldrive*100); system.out.println(percentageused); the print statement returns 0. can not getting desired value you dividing long long, refers (long/long = long) operation, giving long result (in case 0). you can achieve same thing casting either operand of division float type. long percentageused = (long)((float)totaloccupied/totaldrive*100);

asp.net mvc - Does not contain a definition for 'AddToPosts' and no extension method -

i still learning asp.net/mvc , following along tutorial matt blagden (you tube) on building blog.. after making post controller getting error in snippet of code handles adding tag post if new post. thought method addtoposts should have been generated when added new entity data model. the error is: blog.models.blogmodel not contain definition 'addtoposts' , no extension method 'addtoposts'. postscontroller.cs accepting first argument of type 'blog.models.blogmodel' found (are missing using directive or assembly reference?) the portion of code giving me error is: if (!id.hasvalue) { model.addtoposts(post); } here entire post controller using system; using system.collections.generic; using system.linq; using system.web; using system.web.mvc; using blog.models; using system.data.entitymodel; using system.text; namespace blog.controllers { public class postscontroller : controller { // access model

dns - List of CDN domains -

is there place when can see list of popular cdn domains? i use opendns treewalk, , i'd add rules treewalk use isp dns cdn. check out source code of webpagetest.org. have complete list of cdn domains https://github.com/wpo-foundation/webpagetest/blob/master/agent/wpthook/cdn.h

digital signature - Digitally Signing Vbscript with timestamp -

strcomputer = "." set objwmiservice = getobject("winmgmts:" &_ "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2") set objsigner=createobject("scripting.signer") set objfso = createobject("scripting.filesystemobject") set objfolder = objfso.getfolder("f:\\code\\signedscripts") set collistoffiles = objfolder.files cert = "example" store = "root" each objfile in collistoffiles objsigner.signfile objfile, cert, store next i using above script digitally sign vbscripts , need timestamp signed scripts. how use timestamp in script ?

android - I need help linking an app to another and opening a URL -

i need android application trying make personal use. i want use adobe flash pro. can make gui, need code makes work. this intention: when click on button, opens app (vplayer or mx player) , player opens rtmp stream. basically, want app open url app. please me this. thank you. you can use below code: assumptions: hope looking code in java. you have imagebutton on screen id imagebutton1 you have url ready before calling code. code explanation: a reference imagebutton created , on click listener set it. use intent , set url data. now, onclick fire intent handled app on android system capable of handling data. imagebutton my_icon= (imagebutton) findviewbyid(r.id.imagebutton1); my_icon.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { intent intent = new intent(intent.action_view); intent.setdata(uri.parse(url)); startactivity(intent); } });

How to Set Custom Keyboard as Default keyboard of devise in Android. -

i working on custom/soft keyboard application want use keyboard default keyboard , set auto completion normal keyboard not getting how . i need urgently search language & input in settings.

java - Very slow file copying to Windows network using JCIF -

i'm trying copy file local machine shared folder in windows server. function used. public static void copyfileusingjcifs(final string domain, final string username, final string password, final string sourcepath, final string destinationpath) throws ioexception { final ntlmpasswordauthentication auth = new ntlmpasswordauthentication(domain, username, password); final smbfile sfile = new smbfile(destinationpath, auth); final smbfileoutputstream smbfileoutputstream = new smbfileoutputstream(sfile); final fileinputstream fileinputstream = new fileinputstream(new file( sourcepath)); final byte[] buf = new byte[16384]; int len; while ((len = fileinputstream.read(buf)) > 0) { smbfileoutputstream.write(buf, 0, len); } fileinputstream.close(); smbfileoutputstream.close(); } i tried this answer, didn't work me. when normal copying(copy , paste) takes maximum of 8minutes 25mb file. when use java program using funct