Posts

Showing posts from September, 2014

ruby on rails - what is the maximum amount of flags flag_shih_tzu can handle? -

i'm using "flag_shih_tzu" gem , want know maximum amount of flags can handle, or depend on int. length in flags column? need handle 64 flags. can it? i maintainer of flag_shih_tzu. best practice: each column used flags should have @ 16 flags set, performance reasons. find performance suffers columns holding more 16 flags. workaround: single table can have multiple flag columns. i create design follows: class foo ... has_flags 1 => :is_a1, # ... snip ... 16 => :is_a16, :column => 'flag_col_a' has_flags 1 => :is_b1, # ... snip ... 16 => :is_b16, :column => 'flag_col_b' has_flags 1 => :is_c1, # ... snip ... 16 => :is_c16, :column => 'flag_col_c' has_flags 1 => :is_d1, # ... snip ... 16 => :is_d16, :column => 'flag_col_d' end now...

Postgres array of JSON avoid casting -

issuing on postgressql 9.2 following: create table test (j json, ja json[]); insert test (j) values('{"name":"alex", "age":20}' ); -- works fine insert test (ja) values( array['{"name":"alex", "age":20}', '{"name":"peter", "age":24}'] ); -- returns error the first insert works fine. second insert returns error: column "ja" of type json[] expression of type text[] i can cast type prevent error: insert test(ja) values( cast (array['{"name":"alex", "age":20}', '{"name":"peter", "age":24}'] json[]) ); -- works fine my question if there way avoid casting? insert test(ja) values ('{"{\"name\":\"alex\", \"age\":20}", "{\"name\":\"peter\", \"age\":24}"}'); to avoid confuse escaping cast...

html - Send Form with email attached in PHP -

i have html form.i want send clients. what best ways send client via email client can download form i tried cread pdf , send pdf document can not create proper pdf html. so there other way out pdf? $pdf->writehtml($html, true, false, true, false, ''); $pdf->lastpage(); $sr = $filename . '.pdf'; $pdf->output('tmp_email/'.$sr, 'f'); note:my email function working good... my question type of document should created without pdf? can send html attached?how? swiftmailer option creating html emails: http://swiftmailer.org/ when generating pdfs html, might want take @ dompdf: https://github.com/dompdf/dompdf it supports images, external stylesheets , loads of other things: http://pxd.me/dompdf/www/examples.php

How to get 'milliseconds' as a part of time in perl? -

this question has answer here: get time in milliseconds without installing package? 1 answer i need time in format "20130808 12:12:12.123" i.e., "yyyymmdd hour:min:sec.msec" . i tried my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year += 1900; $mon++; if ($mon<10){$mon="0$mon"} if ($mday<10){$mday="0$mday"} if ($hour<10){$hour="0$hour"} if ($min<10){$min="0$min"} if ($sec<10){$sec="0$sec"} doesn't provide `msec` part of time. how can ? here's complete script. proposed before, using time::hires::time microsecond support, , it's using posix::strftime easier formatting. unfortunately strftime cannot deal microseconds, has added manually. use time::hires qw(time); use posix qw(strftime); $t = time; $date = strftime ...

apache spark - java.lang.NoClassDefFoundError: scala/reflect/ClassManifest -

i getting error when trying run example on spark. can please let me know changes need pom.xml run programs spark. currently spark works scala 2.9.3. not work later versions of scala. saw error describe when tried run sparkpi example scala_home pointing 2.10.2 installation. when pointed scala_home @ 2.9.3 installation instead, things worked me. details here .

variables - Restrict Upload on FileSize for FCKeditor PHP -

hi add restriction on uploading image files, on 500kb fck editor. so in fck edior upload script there included require files: require('./config.php') ; require('./util.php') ; require('./io.php') ; require('./commands.php') ; require('./phpcompat.php') ; filesize calcualted in commands.php file , thought take variable (from within function (commands.php) , test see if breaks limit size) so still in upload.php, have snippet underneath require includes: $limit_size = 512000; if ( $globals['myfilesize'] >= $limit_size ) { senduploadresults( 1, '', '', ''. $globals['myfilesize'].'' ) ; } so here function within commands.php file: function getfoldersandfiles( $resourcetype, $currentfolder ) { global $ifilesize; // map virtual path local server path. $sserverdir = servermapfolder( $resourcetype, $currentfolder, 'getfoldersandfiles' ) ; // arrays hold fol...

php - Setting a button text dynamically in jquery -

i trying set text of button of dialog in jquery. have 2 variables value change dynamically. these values should set button text. have written following code. var monthnames = [ "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" ]; var today = new date(); var month = monthnames[today.getmonth()]; var nextmonth = monthnames[today.getmonth()+1]; $( ".selector" ).dialog({ buttons: [ { text: month, click: function() { $(this).dialog("close"); } }, { text: nextmonth, click: function() { $(this).dialog('close'); } } ] }); }); but form dialog not loading. pls me valuable suggestions. your code working fine, make sure have added jquery , jquery ui reference , have selector class in html mark...

composer php - Why does Symfony create a separate vendor folder in my root? -

when install symfony according guide (option 1 composer) creates folder structure expected (and mentioned in guide): path/to/webroot/ symfony/ app/ src/ vendor/ web/ but in root folder creates empty vendor/ folder. in vendor folder there subfolder named composer/ . path/to/webroot/ symfony/ vendor/ composer/ both directories empty (no hidden files). 2 questions: is required folder or kind of bug these folders installed? or may directory composer-specific files? can delete folder without danger? that empty folder generated when don't pass target-directory parameter composer: php composer.phar create-project vendor/project target-directory [version]

.net - How to reference a DataGridViewCell by column name in a DataGridViewRow? -

i'm populating datagridview shown in code below. while each created row associated parent datagridview , in columns created, cannot reference cells in row column name. is there way me reference column name? rather avoid using integer based index. edit : note columns of datagridview has been created , correctly named using visual studio designer. private sub setserviceorders() dim row datagridviewrow = nothing dim rowvalues iserviceorderdatagridviewrowvalues = nothing me.serviceordersdatagridview.rows.clear() if not _serviceorders nothing andalso _serviceorders.count > 0 each serviceorder serviceorder in _serviceorders.values rowvalues = serviceorder row = new datagridviewrow() me.serviceordersdatagridview.rows.add(row) row 'this fails: "specified argument out of range of valid values." .cells("statusimagecolumn").value = my.resources.bulletg...

Return which image from a vertical list is currently in the viewport with jQuery? -

i have vertical list of images user scrolls view. how can make jquery tell me image in viewport? here fiddle close want. http://jsfiddle.net/y6pjg/ what change border if image more 30 pixels top. want change if statement check position bottom. $(document).ready(function() { // check on page load docheck(); // check on scroll $(window).scroll(function(){ docheck(); }); }); function docheck(){ $('#list li').each(function(index){ var item = $(this); if((item.offset().top - $(window).scrolltop()) > 30){ item.css('border-style', 'solid'); }else{ item.css('border-style', 'none'); } }); }

iphone - Stop the Opening of the application from the lock screen -

how stop opening application lock screen when notification came for e.g: got local notification app, when phone locked opened lock automatically opening app how stop it. you cannot stop behaviour, it's embedded ios. if put device sleep after notification slide return slide unlock. notifications showing @ top.

java - Socket connection works over LAN but not WAN (internet) -

i have question i'm sure simple, don't know answer. i have created chat program allows 2 users connect directly each other provided know port , ip of other user. socket try { if (ip != null && checkip(ip)) { connection = new socket(ip, port); out = new printwriter(connection.getoutputstream(), true); in = new bufferedreader(new inputstreamreader( connection.getinputstream())); system.out.println("connected"); printtimestamp(); styleddocument doc = maintext.getstyleddocument(); style style = maintext.addstyle("connection", null); styleconstants.setforeground(style, color.orange); try { doc.insertstring(doc.getlength(), "connection open to: " + ip + "\n", style); } catch (exception e) { e.printstacktrace(); } listenserve...

javascript - Of scraping data, headless browsers, and Python -

so i'm cs student trying learn web scraping , do's , dont's come along it. after messing imacros , few other data scraping 'tools', turned python, language not familiar @ time. learned beautifulsoup , urllib2, , blundered way through learning through stackoverflow , few other forums. now, using knowledge ive gained far, can scrape static web pages. however, know era of static pages over, js reigns supreme on mediocre websites now. i please guide me in right direction here. want learn method load javascript-laden webpages, load content, , somehow data beautifulsoup function. urllib2 sucks @ that. ability fill in forms , navigate through button clicks. mostly websites im interested in consist of long list of results load scroll down. loading them , downloading page doesnt seem help(dont know why is). i'm using windows 7, , have python 2.7.5 installed. i've been told headless browsers such zombie or ghost me, dont know those. tried using libraries s...

email - PHP-made e-mail not showing up in iPod -

some time ago i've created php-script sends mime-encoded e-mails. works fine, inclusive attachments , inline images. strangely, these e-mails not show in inbox of ipod touch (3th generation, ios 5.1.1), although show in windows live mail, gmail , ipads/iphones of higher generations. i've compared source of original message original message forwarded gmail (as forwarded message doest recognised ipod). seems there not single difference in mime-structure. does knows whether there has specific sequence of to, from, subject, ...-headers working? here sample message: [bladibladibla] date: wed, 7 aug 2013 13:02:31 +0000 to: name <email@domain.com> subject: test 5 x-php-originating-script: 0:email.php mime-version: 1.0 from: name <email@domain.com> reply-to: name <email@domain.com> content-type: multipart/mixed; boundary=boundmixed --boundmixed content-type: multipart/related; boundary=boundrelated --boundrelated content-type: multipart/alter...

jquery fadeOut not working when callback used -

i have div fades in callback works: div.fadein(600, function(){ sidenote(nlevel); }); at other point though div may need fade out again. div.fadeout(500); this happens function called onclick event. normally can work. seems when use callback can't. (it happened elsewhere, when removed callback on 1 worked fine. cannot here) thanks are u looking ?? have @ jsfiddle demo $(".story1").fadein("50", function () { $(".story2").fadeout("100"); });

Java: Experimenting with generics -

lastly experimenting generics little bit. came piece of code: public class test { static <t> void f(t x) { x = (t) (integer) 1234; system.out.println(x); } public static void main(string[] args) { f("a"); f(1); f('a'); f(1.5); f(new linkedlist<string>()); f(new hashmap<string, string>()); } } i ran , got output: 1234 1234 1234 1234 1234 1234 with no exceptions! how possible? it's because of type erasure (a lot has been written this, google term). after compiling f byte code method might this: static void f(object x) { x = (object) (integer) 1234; system.out.println(x); } so system.out.println call tostring method on object x - , in case integer.tostring() .

iphone - Text underline and highlight in PDF rendering -

i using following project git hub pdf rendering, need provide user feature of underlining text , highlighting text in pdf but when tried use web view pdf rendering able highlight text , not underline it i have tried using cgpdfdocument pdf rendering not able feature text highlight nor underline text i need achieve text underline , text highlighting in pdf rendering extract text any appreciated thank you its not easy make annotations in pdf using ios, can use quartz framework . can reference here add annotation pdf add annotation on pdf annotate pdf within iphone sdk annotation notes comments using quartz 2d in ios or can check libraries here pspdfkit fastpdfkit html pdf viewer ios xcode project pdftouch sdk ios poppler

ios - #tag suggested UITextView with attributed text while editing -

i working on app in using wutextsuggestioncontroller #tag suggested textview can check controller here https://github.com/yuao/wutextsuggestion . works fine when start typeing # or @ ,it gives right result. now question is,how change color of #tag vlaue in uitextview means when type "#test students",then #test in different color , remaining text in regular color. any help,any small suggestions welcome. i hope may , sort out problem -(bool)textview:(uitextview *)textview shouldchangetextinrange:(nsrange)range replacementtext:(nsstring *)text{ { nsmutableattributedstring * string = [[nsmutableattributedstring alloc]initwithstring:textview.text]; if([text isequaltostring:@"#"]){ nsrange range=[textview.text rangeofstring:text]; [string addattribute:nsforegroundcolorattributename value:[uicolor redcolor] range:range]; } [self.text setattributedtext:string]; }

c++ - boost windows_shared_memory on linux -

hi need build 1 project on linux use "boost/interprocess/windows_shared_memory.hpp" way run on linux, or must rewrite code ? thanks i think need use #include <boost/interprocess/managed_shared_memory.hpp> instead of boost/interprocess/windows_shared_memory.hpp . handle both windows , linux.

java - Serialize own class -

i'm experiencing problems serialization of java , haven't found error. want serialize class, save , read again. class want serialize: public class musicitem implements serializable { private static final long serialversionuid = 6429052113846297403l; public string title; public string album; public string artist; public string art; public string musiclocation; } and when want write following error: 08-07 14:21:37.723: w/system.err(9557): java.io.notserializableexception: de.godev.gomusic.mainactivity i hope can me. thanks in advance, the class not getting serialized de.godev.gomusic.mainactivity please post source of mainactivity class well

ocean - PluginPackager exited with code 99 -

using ocean wizard have generated pip project , trying build after adding things deploylist.xml. following message: command ""%ocean2013home%\pluginpackager.exe" /p "c:\ext_source\ext_6_1_2013\ocean\ikonrockphysicsworkflowpip2013\obj\copytemp\ikonsyntheticsplugin.dll" "c:\ext_source\ext_6_1_2013\ocean\x64\release\ikonrockphysicsworkflowpip2013.pip"" exited code 99. does know code means , how fix it? other pip project builds fine , includes same contents except 2 dll's. removing these 2 dll's still not work. the error seeing due 1 of following: the pip file not contain public plugin class you have more 1 plugin class in pip your assemblies referencing wrong petrel public assemblies

android - How can I get the emulator working for my Samsung Galaxy Note 8.0? -

i download package here: http://developer.samsung.com/android/tools-sdks/samsung-galaxy-tab-emulator appears emulator i'm looking for. problem instructions listed not match android sdk manager have installed. as such, i'm not sure how proceed emulate samsung galaxy note 8.0 tablet , deploy it. i not sure if solution, not able test myself (have no sdk side now). tutorial samsung 2011, little bit older , not adapted new android sdk or eclipse. maybe have try following: extract zip file, there must folder "skins" , subfolder inside "skins" named "galaxy tab". copy subfolder android sdk directory: /platforms/android-9/skins/ but check @ target api develop, folder "android-9" depends on target api need. now, restart eclipse if open, , open avd manager. select "new", there must category "skins", here should able select added emulator , build avd galaxy tab. try it, if doesn´t work, try later if @ ho...

internet explorer - IE Text box error in search bar -

Image
i have problem in ie, when start writing in text box got ">" arrow @ end of text box. in others browser doesn't show, had similar problem ? thanks what you're seeing half of x symbol added input fields recent versions of ie. this x "clear field" button. ie has added new feature in ie10. the reason you're seeing half of because go button sittin on top of it, overlaying edge of field. may or may not intentional, either way can solve issue either moving go button, or adjusting length of field. which way go depend on whether want x visible or not. choose hide behind go button, or shorten field size x visible. you. [edit] alternatively can use css rid if don't want x appear @ all. input::-ms-clear { display: none; } this remove input fields. or replace input classname or other selector if want remove specific fields. (with @mikrimouse reminding me of css option) hope helps expain things.

com.android.camera.action.CROP doesn't work at landscape mode -

i have issue: need take photo camera , show screen possibility crop photo taken. added suchfunction: protected void callcropphoto(uri uri) { try { intent intent = new intent("com.android.camera.action.crop"); intent.setdataandtype(uri, "image/*"); intent.putextra("crop", "true"); intent.putextra("aspectx", avatar.getwidth()); intent.putextra("aspecty", avatar.getheight()); intent.putextra("outputx", avatar.getwidth()); intent.putextra("outputy", avatar.getheight()); intent.putextra("return-data", true); startactivityforresult(intent, crop_photo_request_code); } catch (exception ex) { // devices can't support image cropping. } } when result camera photo call function temporary uri taken photo. when calls onactivityresult usualy result_ok , d...

javascript - cross browser issues jquery dropdown menu -

ok made site while , had issues menu system needed. click location on map, displays list of sub locations in dropdown menu right. these chance display based on options class. i have put site @ shiftera.co.uk can see their. the issue first. 1) ie - list never filters out, displays results time regardless of class. 2) chrome - dropdown squashed showing 1 result , hiding others need use up/down arrows change, shows 3, 4. 3) firefox - list displays in 1 long row, not usual dropdown. i think issue more of css problem or multitude of css problems. an example of map link is <a href="scotland#browse" class="areaselect" id="scotland" title="scotland">scotland</a> the dropdown list although not seperated generated database , appears below <option value='ab25 1uh' class="scotland">aberdeen</option><option value=' wa14 4dw' class="northwest">altrincham</option> as ca...

How to check the link is enabled in Webdriver using java? -

Image
i have searched forums before posting issue here. have found answers not able success answers in that. issue how check link enabled in webdriver using java. please find attached screen shots same. i have written code this: webelement textlink = driver.findelement(by.id(or.getproperty("lnkview_id"))); if (textlink.isenabled()) system.out.println("view link: enabled"); else system.out.println("view link: disabled"); please me out issue. appreciated. try following: string isdisabled = textlink.getattribute("disabled"); if (isdisabled==null || !isdisabled.equals("disabled")){ system.out.println("view link: enabled"); }else{ system.out.println("view link: disabled"); } it looks attribute "disabled" toggle whether enabled or not, can check using getattribute();

mysql - How to run the PHP and/or CodeIgniter function continuously -

i working on location-based social networking website integrating foursquare . have used login foursquare, whenever user login foursquare account access token using data foursquare account large , takes lot of time. that's why looking solution retrieve foursquare data continuously in cycle. is there way run codeigniter or php function continuously update users data instead of updating data scheduled basic using cronjob , should run once run function run infinite time without stop. note: i using curl data foursquare thanks in advance! you can write simple php script following , run script scheduling in cron job , once script runs, delete cron tab (the script keep runing): while (true) { // setup curl request foursquare // fire curl request , results // processing // can put sleep here before again loops // here magic break infinite loop - check // variable database table or ini file , break loop // if variable set } hope helps...

.net - WMI instancename retrieved from performancecounter (for a network card) is not then accepted when used to retrieve counter value -

my basic problem want find total network io list of ip addresses. many of servers have different nics , have teamed nics. since seems need have exact name network interface instance have created array of instance names: dim category new performancecountercategory("network interface") dim instancenames string() = category.getinstancenames() i step through names , add list of performancecounter objects: each instancename in instancenames network.add(new performancecounter()) network(i) .categoryname = "network interface" .countername = "bytes total/sec" .instancename = instancename .machinename = ip_address end try network_usage = network_usage + network(i).nextvalue() catch ex exception end try = + 1 next the problem names generated first part of code raise e...

c# - Copy file from internal server to remote server in IIS 7 -

i have application written in c# after creating pdf file, needs save pdf file virtual folder in remote server. server in dmz , created 2 users in both servers same permissions. 2 servers not in same network. i'm able access dummy pdf file using string stempsourcefilespec = "https://servername/virtualfolder/dummy.pdf"; b = file bytes; //here write bytes system.io.file.writeallbytes(stempsourcefilespec, b) , i'm having problems when copying pdf file same virtual directory. user i'm using has full permissions on folder. this works internally when using \servername\folder\, doesn't work when try save remote virtual directory. thoughts? try convert virtualpath phyicalpath in handler, such system.web.httpserverutil.mappath http://asp.net.bigresource.com/uploading-files-to-server-and-saving-outside-virtual-path-bmvjftyf4.html#l9lpkwyji http://forums.iis.net/t/1157234.aspx

php - Form post not working in while loop result -

i'm pulling customer bookings database dependent upon date, seems working fine. decided add button within form, in table, send record invoicing page. seems work except first result in table. form post post invoicing page below first result, first result nothing, refresh page. when looking @ source code looks correct, isn't working if there 1 result or doesn't work first result, if there more one. need use other while loop? <?php $i=0; while ($i < $num) { $id = mysql_result($update4, $i, "id"); $booking_date = mysql_result($update4, $i, "booking_date"); $date = date("m/d/y", strtotime($booking_date)); $customer_name = mysql_result($update4, $i, "customer_name"); $customer_address = mysql_result($update4, $i, "customer_address"); $customer_city = mysql_result($update4, $i, "customer_city"); $starter1 = mysql_result($update4, $i, "start_time"); $starter = date("g:i a...

PHP-Submit a form to different pages according to variable values -

i wondering in php web page, like <form method = "post" action = ?> age: <input type = "text" name="age"> submit: <input type="submit"> </form> for example, if input age larger 18, go page: a.php; else goto b.php how can fulfil that, in current page or in next forwarding page? more specifically, if want in current page, what think action="function()", , inside function, judgement go a.php or b.php. correct way write action , function()? , saw using onclick="..." well, difference? if want in next page, we can write action="c.php" , judgement in c.php page. if so, how in c.php page? btw, way common used way? thanks, eve best way submit same page. <form method = "post" action = 'c.php'> age: <input type = "text" name="age"> submit: <input type="submit"> </form> in c.php ...

spring - Use an ApplicationContextListener or @PostConstruct to -

in 1 of our beans reading file based data in memory. would better applicationcontextlistener e.g. calling beans init() method, or adding @postconstruct init() method container automatically? you can use: 1. @postconstruct 2. initializingbean interface 3. <bean class="your bean class" init-method="your init method"/> attribute : init-method : name of custom initialization method invoke after setting bean properties. method must have no arguments, may throw exception. alternative implementing spring's initializingbean interface or marking method postconstruct annotation. they alternative: if program totally annotated go annotation, if xml go xml (i don't mixing , don't need ask if implements feature annot or xml) edit: context listener: called every context refresh (usually once, @ startup) initializingbean or @postconstruct : apply bean's lifecycle called every time bean created (depends scope) in case us...

common lisp - How to insert multiple records at once using the clsql provided FDML -

is there way of using given fdml interface insert multiple records @ once? the given insert-record statement can handle 1 value tuple @ once , idea of calling function uncountable times, instead of once bugging me quite bit, , guess (without having done profiling) not fastest approach either. how this? ; slime 2013-04-02 cl-user> (ql:quickload "clsql") load "clsql": load 1 asdf system: uffi install 1 quicklisp release: clsql ; fetching #<url "http://beta.quicklisp.org/archive/clsql/2013-04-20/clsql-20130420-git.tgz"> ; 900.99kb ================================================== 922,610 bytes in 1.92 seconds (468.78kb/sec) ; loading "clsql" [package uffi].................................... [package cmucl-compat]............................ [package clsql-sys]............................... [package clsql]................................... [package clsql-user].............................. .....................

git - How to push Drafts to Gerrit? -

i unable push drafts gerrit. when try push drafts gerrit throwing following error. [3:37pm] [myrepo] -> git push origin head:refs/drafts/remote counting objects: 167, done. delta compression using 8 threads. compressing objects: 100% (80/80), done. writing objects: 100% (124/124), 58.19 kib, done. total 124 (delta 75), reused 47 (delta 32) remote: resolving deltas: 34% (26/75) to ssh://myrepo ! [remote rejected] head -> refs/drafts/remote(prohibited gerrit) error: failed push refs 'ssh://myrepo' can 1 me out in issue? use command: git push --receive-pack="git receive-pack" origin {commit sha-1 or head}:refs/drafts/{branch} a general rule push gerrit, branch = master: git push origin <a_local_branch_name or specific_commit or head>:refs/for/master a general rule push gerrit draft, branch = master: git push origin <a_local_branch_name or specific_commit or head>:refs/drafts/...

outlook - mailitem.Save The operation cannot be completed because the objct has been deleted -

i'm trying make copy of mailitem, move copy different location , add custom item property it. after add custom property, item wont save , crash error mentionned above. here's code, me figure out please! dim objcopieditem, objcontrolitem set objcopieditem = item.copy call objcopieditem.move(objpstfolder) dim property1 : set property1 = getmigrationproperty(objcopieditem.itemproperties) if property1 nothing set property1 = objcopieditem.itemproperties.add("migration id", 1) property1.value = item.entryid objcopieditem.save else property1.value = item.entryid objcopieditem.save end if the error occurs @ objcopieditem.save, operation works without problems if add properties original item , copy/move , new item, delete property on original item. move function returns new item, not sub: set objcopieditem = item.move(objpstfolder)

Foundation and AngularJS -

i modifying application using zurb's foundation framework responsiveness , angularjs. there bug data displayed in table <tr ng-repeat="obj in entries">...</tr> has <td> 's hidden/shown based on foundation's responsive rules. unfortunately, when angular model updated, foundation doesn't re-flow newly rendered dom. i have tried using $(document).foundation('table') found in extensive google searching, didn't trigger reflow of responsive collapsed table. added directive trigger simple $(window).trigger('resize') works first call, subsequent calls not. anybody else run this? you mixing 2 technologies dont play nice together. the js assets provided zurb foundation inevitably have conflicts digest cycle in angularjs. reason --- angular-bootstrap projects emerged transform jquery plugins angularjs directives. http://angular-ui.github.io/bootstrap/ i don't believe same level of support, "if any...

vba - How to split Full Name field into First Name, Last Name and Middle Initial? -

i have table field called patrn name set first_name, last_name m.i. examples: smith, james m jones, chris j. anderson, wendy l how can break field 3 different fields called first_name, last_name, , mi ? tried running query last_name: [patrn name]" & ", " last name didn't results. didn't design table way realize wasn't smart make full field name without individual field names; i'm in charge of fixing it. consider whether can bend split function will. here example immediate window session. patrn_name = "smith, james m" ? patrn_name smith, james m ? split(patrn_name, ",")(0) smith ? trim(split(patrn_name, ",")(1)) james m ? split(trim(split(patrn_name, ",")(1)), " ")(0) james ? split(trim(split(patrn_name, ",")(1)), " ")(1) m you can't use split() in query directly. build 1 or more user-defined functions , call udf(s) query. that a...

jquery - Resizing browser stops width:100% background over css -

my website www.onlinemoviesbox.com having slight css issue. when resize(make browser width smaller) vertical scrollbar appears , if scroll right see header background corrupts , not continue(black background). went on lots of similar questions , wasn't able fix issue similar answers. tried removing header div width pixels percentage , didn't work. i'd happy if me fix header no matter how resize , scroll have background continued. thanks i see on page's html: <div class="topheader" style="width:100%;background:#000;"> it looks width:100% problem there. try setting min-width there too, width horizontal scrollbar first appears.

objective c - NSNotification sent once, but is received multiple times -

i communicating between 2 classes nsnotificationcenter. problem although tap button once (and button fires off once) unintentionally producing increasing numbers of notifications 1 call nsnotificationcenter. here better explanation of problem, code: my 2 classes mainview class , menu class. when view in mainview class tapped, launches view created , governed menu class. code called when mainview initialized: menu=[[mymenu alloc] init]; uitapgesturerecognizer * tap=[[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(ontapped:)]; [tap setnumberoftapsrequired:1]; [container addgesturerecognizer:tap]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(onchangeitem:) name:@"itemchange" object:nil]; this gesture recognizer fires off method, in mainview class: - (void) ontapped: (uigesturerecognizer*) recognizer { nslog(@"tap"); [menu displaymenu]; } this how menu class initializes: - (mymenu*) in...

What type of copy does the default java.lang.Object.clone() method perform -

i new java can 1 tell me please. shallow copy : primitive types , references copied deep copy : objects copied recursively there no default implementation clone() you can @ documentation clone() : the method clone class object performs specific cloning operation. first, if class of object not implement interface cloneable , clonenotsupportedexception thrown. note arrays considered implement interface cloneable , return type of clone method of array type t[] t[] t reference or primitive type. otherwise, method creates new instance of class of object , initializes fields contents of corresponding fields of object, if assignment; contents of fields not cloned. thus, method performs "shallow copy" of object, not "deep copy" operation.

php - JOIN Query for Specific Table -

i have following tables: login iduser (int) username (var) pass (var) photos idphoto (int) title (var) iduser (int) following iduser (int) followingid (int) i trying create query fetches 'photos' people following. so far, have created query grabs 'photos' across service: $query = "select idphoto, title, l.iduser, username photos p join following login l on (l.iduser = p.iduser) following.followingid = following.userid order idphoto desc limit 50; any appreciated. select p.*, l.iduser, l.username following f left join login l on f.followingid = l.iduser left join photos p on p.iduser = l.iduser f.iduser = 1 limit 50 this should fetch photos of people followed user id = 1 in example.

android - How to display fragment *over* tabulation setup as Play Store Settings does? -

my application has 3 main screens (1 fragment each) presented in action bar compat navigation_mode_tabs . from action bar , menu, user able reach settings, profile, credit card etc. which less used functionality. feel (from android guidelines) should not regrouped inside 4th tabulation (as currently). how display less-used fragments similar feeling way google play creates , displays screen settings (leaving tabs mode)? need secondary activity? can stay in same activity (best case me) , how? create second activity, can show other fragments. can put flag in intent, need startactivity() method, can check fragment should shown in otheractivity. navigation need edit manifest this, set activity hirarchy: <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/mytheme" > <activity android:name="com.test.activitymain" ...

ssis - Changed MaximumErrorCount to 9999 but still getting an error that says it is set to 1 -

i running sql task, though whenever runs stops , gives me error: "...the number of errors raised (50) reached maximum allowed (1); resulting in failure" despite fact set maximumerrorcount in properties , other tasks in package 9999. gives? the package fail if tasks have maximumerrorcount set 9999 package needs maximumerrorcount set higher number other 1. if package has maximumerrorcount property set higher number, can return success result if tasks inside fail. be sure if task expected fail, dependent task use precendence constraint completion value rather success value, if want them run after 1st task attempted.

How to add two matrices in c++ -

i write class , have problem adding matrices. know have overload operator +, don't know how exactly. ideas ? class cmatrix { private: int rows; int columns; float* pdata; public: cmatrix(void); cmatrix(int rows, int columns); void setelement(int row, int column, float element); float getelement(int row, int column); ...}; istream& operator>>(istream& in, cmatrix& matrix) { in >> matrix.rows; in >> matrix.columns; for(int = 0; < matrix.rows; i++) for(int j = 0; j < matrix.columns; j++) in >> *(matrix.pdata + * matrix.columns + j); return in; } cmatrix::cmatrix(int rows, int columns) { rows = rows; columns = columns; pdata = new float[rows * columns]; float* pend = &pdata[rows * columns]; for(float* p = pdata; p < pend; p++) *p = 0.0; } ...

java - apache httpclient doesn't set basic authentication credentials -

have @ following code: defaulthttpclient http = new defaulthttpclient(); http.getcredentialsprovider().setcredentials( new authscope(authscope.any_host, authscope.any_port), new usernamepasswordcredentials( configuration.username, configuration.developerkey ) ); httppost post = new httppost(strurl); stringentity entity = new stringentity( ac.toxmlstring() ); entity.setcontenttype("text/xml"); post.setentity( entity ); org.apache.http.httpresponse response = http.execute( post ); it produces no errors. response server "no authorization header". checking request wireshark unveils there indeed no basic authentication set. how possible? okay, default basic authentication turned off. however, enabling far complicated ( link ) . therefor...

php - WordPress Gravity forms with pretty url (url rewrite) on IIS7 -

we have issue wordpress instance running on iis 7 server. gravity forms used ask user there information. when fill gravity form information entered user works charm. though, when information prefilled in gravity form using parameters ?param1=1&param2=2 result no entry in database. if disable wordpress pretty urls , add paramaters again url form works again. so, concluded has something rewrite rules. far our current analysis goes (and knowledge on iis's behavior on rewrite rules). i added current web.config bellow. hope can give hand. <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webserver> <httperrors errormode="detailed"> </httperrors> <rewrite> <rules> <rule name="wordpress" patternsyntax="wildcard"> <match url="*"/> <conditions> <a...

c++ - controlling paintGL method - How to decide what to paint? -

i want control paintgl method keypress-event. aim show additional point pushing return. in other words: have painted nice background scene , want push return (in lineedit) , there appears red point in front of shown background. //mainwindow.cpp mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent), ui(new ui::mainwindow) { ui->setupui(this); glwidget = new glwidget; connect(ui->lineedit, signal(returnpressed()), glwidget, slot (set_draw())); } //glwidget.h #ifndef glwidget_h #define glwidget_h #include <qglwidget> #include <qmessagebox> #include "mainwindow.h" #include "cstdio" class mainwindow; class glwidget : public qglwidget { q_object mainwindow *mymainwindow; public: glwidget(qwidget *parent = 0); //~glwidget; int draw; void initializegl(); void paintgl(); void resizegl(int w, int h); public slots: void set_draw(); }; #endif // glwidget_h //glwidget.cpp gl...

popup - Overlay two Silverlight apps -

i wondering if possible have 2 silverlight apps overlway each other. have silverlightapp1 take whole browser window, silverlightapp2 show popup in center of window modal transparent background. silverlightapp2 take window space (to act modal , block access silverlightapp1), since background transparent act modal , have main container element accessible. is possible? i kind able achieve not transparency part of it... i know there easier solutions this, working inside existing silverlight application (which silverlightapp1 above) don't have ability modify much, html containing app. thank you! you try make modal javascript window overlays div of silverlightapp1 , place silverlightapp2 on it. maybe should make silverlightapp2 not take window space , make transparent/modal part div. i think work.

apache - Nutch 2.x No errors, No results neither -

i've been playing nutch 2.x awhile, have set according nutch 2.x tutorial advised in this post , still can't figure out - appreciated. when using inject command per tutorial, injects 2 urls have in seeds.txt: nutch inject ../local/urls/seed.txt but when running script doesn't visit of urls: bin/crawl ../local/urls/seed.txt testcrawl *ttp://l*calhost:8983/solr 2 i've started again complete new install of nutch 2.2.1 - hbase-0.94.10 , solr 4.4.0 advised vy on mailinglist, due versions mentioned in tutorial years old, , error i'm getting is: [root@localhost local]# bin/nutch inject /urls/seed.txt injectorjob: starting @ 2013-08-11 17:59:32 injectorjob: injecting urldir: /urls/seed.txt injectorjob: org.apache.gora.util.goraexception: java.lang.runtimeexception: java.lang.illegalargumentexception: not host:port pair: �2249@localhost.localdomainlocalhost,45431,1376235201648

.htaccess - Correct RegEx to avoid infinte loop using RewriteRule to redirect 301 -

i trying tell server redirect following requests: http://example.es http://example.es/ http://example.es/es http://example.es/es/ http://www.example.es http://www.example.es/ http://www.example.es/es to page: http://www.example.es/es/ in order have following in .htaccess #rewriteengine on # turn on rewriting engine rewritebase / rewritecond %{http_host} ^(\.?example\.es(/|/es|/es/)?|www\.?example\.es(/|/es)?)$ [nc] rewriterule ^(.*)$ http://www.example.es/es/ [r=301,l] the problem causes infinite redirects since wanted url http://www.example.com/es/ has http_host string within. thing cannot find accurate regular expression avoid problem. the rest of .htaccess goes follows: php_flag register_long_arrays on php_flag register_globals on addoutputfilterbytype deflate text/html text/plain text/xml text/css javascript application/javascript expiresactive on expiresbytype text/css "access plus 1 years" expiresbytype image/png "access plus 1 years" e...

angularjs - Angular form validation won't trigger -

i'm trying form validation on -url removed- trigger when submit , it's not. believe have things setup correctly missing something. looks angularjs requires model bound on input use validation. see http://jsfiddle.net/adamdbradley/qdk5m/ try removing ng-model="email", run, , you'll notice validation no longer works. <input type="email" id="inputemail" placeholder="email" ng-model="email" required> vs <input type="email" id="inputemail" placeholder="email" required>

powershell - How to add a column of incrementing values to cmdlet output? -

suppose call get-service , want assign new column id cmdlet output prints incrementing integers that: id status name displayname -- ------ ---- ----------- 0 running adobearmservice adobe acrobat update service 1 stopped aelookupsvc application experience 2 stopped alg application layer gateway service i'm trying use select-object right add column, don't quite understand how iterate variable in sort of expression. here's i've got: get-service | select-object @{ name = "id" ; expression= { } }, status, name, displayname | format-table -autosize is there way iterate integers within expression= { } , or going problem wrong way? you can way, though need maintain counter variable outside of main expression. $counter = 0 get-service | select-object @{ name = "id" ; expression= {$global:counter; $global:coun...

insert NaNs where needed in matlab -

i have following 3 vectors , want insert nans b a misses data points in an . bn should [0.1;0.2;0.3;nan;nan;0.6;0.7] . how can bn? thanks.--jackie a=[1;2;3;6;7]; an=[1;2;3;4;5;6;7]; b=[0.1;0.2;0.3;0.6;0.7]; okay first off, cant store string 'nan' 1 cell of matrix, must stored cell array. code snip below gives solution, if cell array okay output. please let me know questions or concerns might have. forget italic parts, david k. % nan solution jackie a=[1;2;3;6;7]; an=[1;2;3;4;5;6;7]; b=[0.1;0.2;0.3;0.6;0.7]; len = max(length(a),length(an)) bn = zeros(len,1); k = 0; % adjust index don't call b outside of size =1 :len ind= a(an(i)==a); if isempty(ind) ==1 bn(i) = nan(1,1) k = k+1; else bn(i) = b(i-k) end end

javascript - Window.Open() is Modifying the page Layout on Internet Explorer -

i have page in asp.net called home.aspx . uses masterpage , have button calling: response.write("<script> window.open('page2.aspx','_blank'); </script>") result: new tab open page2.aspx , if return home.aspx , page layout modified, central <div> moved left of page. what can solve problem? remember occurring on internet explorer, firefox works normally! thanks lot. not going merit on why doing that, response.write killing html/css/js output in home.aspx page , preventing loading properly. try using: scriptmanager.registerstartupscript(typeof(page), "openpage2", "window.open('page2.aspx','_blank');", true); instead of response.write, page loads open window.

devkit - Mule EE jars command populate_m2_repo needs %MULE_HOME% env variable set in windows -

when running populate_m2_repo c:\users\me.m2\repository asked %mule_home% set. typically on computer have more 1 standalone version available testing inconvenient keep changing variable every time new standalone comes out. can explain why populate_m2_repo needs %mule_home% set? thanks ever since mule 3.1.0 recommended not set system wide %mule_home%, since mule.bat script set when not available. that said populate_m2_repo needs know find artifact need installed. hth

css - Animate single element on background -

what efficient way change walk signals on header image on http://www.daniellmusic.com red green. think there'd more efficient way change backgrounds since i'm changing small percentage of it. newbie self appreciated.also, it's wordpress site if makes difference. thank in advance! recreated background image signals transparent, you'll need use png or gif. use background-color css property change color, leaving background-image untouched. .bg { background-color: red; background-image: url('...'); } .bg:hover { background-color: green; }

decimal - Get daily average for specific date range SQL Server -

thanks in advance!! here have far: i selecting total amount of tasks person specific owner given date range. trying exact daily average number of tasks each person. the problem having keeps returning .00 on end of average, rather exact average. example, person may have 2 tasks in week; getting 0.00 average rather 0.28 or 0.29 select convert(nvarchar, count(p.personid)) count, convert(decimal(4, 2), count(p.personid) / datediff(day, @startdate, @enddate)) average, p.personid, p.firstname, p.lastname, c.companyname tasks t join person p on p.personid = t.personid join client c on c.id = p.employer join commission m on m.clientid = c.id t.created between @startdate , @enddate , m.owner in ('john doe') group p.personid, p.firstname, p.lastname, c.companyname order c.companyname, count desc be aware if enddate , startdate identical division 0 error. your problem count(p.personid) , datediff(day,@startdate,@en...

Current Time in DateTime PHP -

is correct way current time in php using datetime? $currenttime = new datetime(); $currenttime2 = $currenttime->format('h:i:s'); i believe can this $date = date('y-m-d h:i:s');

c++ - What is the proper order of initialization of OpenGL inside a QT GraphicsScene? -

the following qt sample straightforward : i'm trying find out why texture shows if application gets timed messagebox. i'm using qt4.8.1 , tried both under linux , vs2008. #include "ui_qtgltest.h" #include <qtgui/qapplication> #include <qtgui/qmainwindow> #include <qgraphicspixmapitem> #include <qgraphicsscene> #include <qglwidget> #include <qmessagebox> #include <qdebug> #include <qtimer> class glitem : public qgraphicspixmapitem // item issue opengl commands { gluint texture[1] ; glsizei w, h; public: glitem(qgraphicsitem *parent = null) : qgraphicspixmapitem(parent){ // when following line commented out, texture doesn't show up. qmessagebox::warning(null,qstring("???"),qstring("hold on second") ); qimage img( "im0.png" ) ; qimage gl_formatted_image; gl_formatted_image = qglwidget::converttoglformat(img); w = gl_f...

c# - ASP.NET for Windows Mobile Screen Size -

i'm developing site needs display nicely on windows mobile device. reason, standard <div> on page scrolls out view entire page, despite contents being in top left corner. there way have screen zoom particular portion of page automatically? have tried set width , height atributes of div element? like: <div style="width:250px; height: 250px;">content</div> p.s.: imo responsive design best option.

javascript - How to do a document.write to load a script without overwriting the whole page -

this question has answer here: what alternatives document.write? 10 answers load scripts after page has loaded? 8 answers i executing code in browser (chrome) through url bar. document.write('<script src=http://example.com/example.js></script>') when executed on page, overwrites , places: <script src=http://example.com/example.js></script> source code of page , launches .js script. question is, possible launch .js script without overwriting entire page small amount of code? if how? try creating script element in javascript during body's onload handler, , append script element created document.

c++ - boost interprocess mutex in managed_shared_memory -

i have thread in process 1 create boost::interprocess::managed_shared_memory segment. in segment allocate boost::interprocess::deque using custom allocator , create boost::interprocess::interprocess_mutex , 2 boost::interprocess::interprocess_condition variables using default allocator. use find_or_construct method create these. i have process (process 2) opens these using find method on boost::interprocess::managed_shared_memory segment have opened in process 2. i understand managed_shared_memory segments have kernel or filesystem persistency , interprocess_mutex/interprocess_condition variables have process level persistency. the scenario getting stuck. 1) process 1 starts thread creates everything. 2) process 2 starts , opens everything, @ stage shared memory , synchronization working well. 3) process 1 restarts thread tries create again (i believe shouldnt though using find_or_construct) 4) process 2 stuck on wait call condition variable though thread in process 1...

csv - spring batch: Dump a set of queries over a database in parallel to flat files -

so scenario drilled down essence follows: essentially, have config file containing set of sql queries result sets need exported csv files. since queries may return billions of rows, , because may interrupt process (bug, crash, ...), want use framework such spring batch, gives me restartabilty , job monitoring. using file based h2 database persisting spring batch jobs. so, here questions: upon creating job, need provide rowmapper initial configuration. happens when job needs restarted after e.g. crash? concretly: is state of rowmapper automatically persisted, , upon restart spring batch try restore object database, or will rowmapper object used part of original spring batch xml config file, or i have maintain rowmapper's state using step's/job's executioncontext? above question related whether there magic going on when using spring batch xml configuration, or whether create these beans in programmatic way: since need parse own config format spring batch job c...