Posts

Showing posts from April, 2011

android - How to show maximum MenuItem on ActionBar if there is room...? -

i'm facing problem dealing actionbar . i have plenty of space on actionbar 2 items shown. please tell me, if there space, how show (maximum) menuitem s on actionbar ? tell me how display overflow menu button? i having similar issue. what did create actionbar object wrote: actionbar.setdisplayshowtitleenabled(false) actionbar.setdisplayuselogoenabled(false) this clear room didn't solve problem. the other thing can in xml file android:showasaction="always" each menuitem .

c++ - Overload resolution without a parameter list on class member access? -

struct x { void f(double) {} static void f(int) {} }; int main() { x x; auto y = x.f; } gcc gives: error: unable deduce ‘auto’ ‘x.x::f’ x.f class member access postfix-expression documented in 5.2.5 [expr.ref] it says: if f (possibly overloaded) member function, function overload resolution (13.3) used deter- mine whether x.f refers static or non-static member function. (from n3485 5.2.5.4.3 ) how can overload resolution applied here - x.f doesn't have parameter list overload resolution? or missing something? update: if change auto y = x.f line expression-statement : - auto y = x.f; + x.f; then gcc instead complains: error: statement cannot resolve address of overloaded function i think you're right in standard isn't precise @ point: [expr.ref]/4 if f (possibly overloaded) member function, function overload resolution (13.3) used determine whether x.f refers static or non-static member function.

iphone - 'UseSegmentedControlViewController.h' file not found -

the line #import <usesegmentedcontrolviewcontroller.h> in little attempt segmented control has led error 'usesegmentedcontrolviewcontroller.h' file not found the lines #import <coremotion/coremotion.h> #import "viewcontroller.h" #import <audiotoolbox/audiotoolbox.h> #import <audiotoolbox/audioservices.h> are fine. is there particular framework should loading? i have: audiotoolbox coremotion corelocation uikit foundation coregraphics tia dr. j if usesegmentedviewcontroller.h view controller wrote, want surround file name in double quotes ( " ), not angle brackets. angle brackets used system-provided headers, not headers in own project.

regex - PHP - Remove duplicate HTML tags -

this question has answer here: how regex-replace multiple <br /> tags 1 <br /> tag? 3 answers i have php string unknown number of br tags. need keep one. start string $str = 'a line of string data<br><br><br><br>with duplicate br tags in here.'; $str2 = 'another line 5 br tags time.<br><br><br><br><br>new line.'; $str3 = 'when it<br /><br><br />breaks'; result $str = 'a line of string data<br>with duplicate br tags in here.'; $str2 = 'another line 5 br tags time.<br>new line.'; $str3 = 'when it<br>breaks'; my thoughts first used str_replace('<br>', '', $str) . don't go because number of duplicate tags in row unknown. some clever regex might solve it? or solution? would nice if w

javascript - Node.js: Error: 403 status code downloading tarball -

i trying install modules in nodejs, using npm, in cases install dont go on, , error returned: error: 403 status code downloading tarball i got again when trying install node-canvas: d:\server\node_modules\canvas\node_modules\canvas>node "c:\program files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild gyp http http://nodejs.org/dist/v0.8.3/node-v0.8.3.tar.gz gyp http 403 http://nodejs.org/dist/v0.8.3/node-v0.8.3.tar.gz gyp warn install got error, rolling install gyp err! rebuild error error: 403 status code downloading tarball gyp err! rebuild error @ request.async (c:\program files\nodejs\node_modules\npm\node_modules\node-gyp\lib\install.js:215:14) gyp err! rebuild error @ request.eventemitter.emit (events.js:115:20) gyp err! rebuild error @ clientrequest.<anonymous> (c:\program files\nodejs\node_modules\npm\node_modules\request\main.js:521:12) gyp err! rebuild error @ clientrequest.g (events.

triggers - Syntax error in SQL with NEW values -

create or replace trigger precio_reparaciones before insert or update on reparaciones each row begin update reparaciones set precio = :new.gasto_material * :new.tiempo_usado * :new.factor :new.garantia = 0; end; sql developer shows syntax error first :new is. (i'm using oracle database express edition 11g.) how can solve it? as reply of comment @kern golstein - you can change trigger below - create or replace trigger precio_reparaciones before insert or update on reparaciones each row begin if :new.garantia = 0 :new.precio := :new.gasto_material * :new.tiempo_usado * :new.factor; end if; end;

android - how to handle the text view link click internally -

i'm using text view display following html content, <div style="width:100%; background-color: #4bcde3; padding-top: 5px; padding-bottom: 5px"> <h2 style=" margin-left: 20"> <a href="http://www.exmaster.com.au/event/13004a8fd9979fe2" style="text-decoration: none; color: white"><span style="border-bottom: 1px solid white">buy tickets</span></a></h2> </div> <div style="width:100%; background-color: rgba(0,0,0,0.0); padding-top: 5px; padding-bottom: 5px"> <div style="width:100%; background-color: rgba(0,0,0,0.0); padding-top: 5px; padding-bottom: 5px"> <h2 style=" margin-left:20"> <a href="tt://artist/10479/nil" style="text-decoration: none; color: white"><span style="border-bottom: 1px solid white">part one: love</span></a></h2> </div

Architecture options for CouchDB messaging app -

i have question regard appropriate architecture on couchdb messaging app use case have. the use case simple messaging platform has 1 couch db messages documents. each document has “to” field indicating intended recipients of message. when client app wakes queries database new messages addressed specific user after last check. achieved querying _changes feed normal filter checking presence of user's id in “to” field in document. as understand couchdb’s operation, requires database retrieve documents changes feed after last sequence , run filter function against them. since likelihood of new message in use case quite low, result in quite large overhead (lets have 100 000 users each getting 2 messages per day, require db read 200 000 message 200 000 times support users?) option 1: read not possible put parametric filter on top of _changes feed. nice, since have been able use replication functionality extract messages. – non starter? option 2: implement view key combin

php - cURL SSL Certificate with Sessions -

i'm trying access ssl website (using curl sessions) have problem ssl certificates. here's curl ssl settings: curl_setopt($ch, curlopt_ssl_verifypeer, 1); curl_setopt($ch, curlopt_ssl_verifyhost, 2); curl_setopt($ch, curlopt_sslkey, dirname(__file__) . '\cacert.pem'); curl_setopt($ch, curlopt_sslcert, dirname(__file__) . '\cacert.pem'; i've downloaded cacert.pem file from: http://curl.haxx.se/ca/ i got error: unable set private key file: 'c:\web\data\localweb\cacert.pem' type pem try options this: curlopt_useragent => 'mozilla/5.0 (compatible; googlebot/2.1; +http://www.google.com/bot.html)', curlopt_cookiefile => 'anc.tmp', curlopt_cookiejar => 'anc.tmp', curlopt_followlocation => 1, curlopt_returntransfer => 1, curlopt_ssl_verifyhost => 0, curlopt_ssl_verifypeer => 0, curlopt_timeout => 120

c - Is it possible to round-trip a floating point double to two decimal integers with fidelity? -

i trying discern whether possible decompose double precision ieee floating point value 2 integers , recompose them later full fidelity. imagine this: double foo = <inputvalue>; double ipart = 0; double fpart = modf(foo, &ipart); int64_t intipart = ipart; int64_t intfpart = fpart * <someconstant>; double bar = ((double)ipart) + ((double)intfpart) / <someconstant>; assert(foo == bar); it's logically obvious 64-bit quantity can stored in 128-bits (i.e. store literal bits.) goal here decompose integer part , fractional part of double integer representations (to interface , api storage format don't control) , bit-exact double when recomposing 2 64-bit integers. i have conceptual understanding of ieee floating point, , doubles stored base-2. observe, empirically, above approach, foo != bar large values of <someconstant> . i've been out of school while, , can't quite close loop in head terms of understanding whether possible or not gi

c - Re-propagate a Caught Signal in Linux -

i trying use sigwait() sigsegv , other signals , (says writing timestamp file). then, program behave if signal never caught (e.g. coredump generated when sigsegv happens -- assuming system configured coredump). i read through couple manpages, , don't see obvious way so. any suggestion? thanks in advance! you can register signal handler won't cause program crash. once receive signal, you'll enter signal handler, , after executing signal handler (write file said), you'll reenter program left off. if want core dump, can use linux core(5) command , create core dump in signal handler without ending process. http://www.alexonlinux.com/signal-handling-in-linux#signal_masks

rdf - Building AliBaba java example -

good evening, i new java persistence api , test alibaba see do. alibaba website . read part of the exemple given here . have whole alibaba project , 2 files exemple, modified little exemple. //document.java package org.openrdf.example; import org.openrdf.annotations.iri; @iri(document.ns + "document") public class document { public static final string ns = "http://meta.leighnet.ca/rdf/2009/gs#"; @iri(ns + "title") string title; public string gettitle() { return title; } public void settitle(string title) { this.title = title; } } and other file: //my main many imports public class main { public static void main(string[] args) throws java.lang.illegalaccessexception { // create document document doc = new document(); // give title doc.settitle("getting started"); system.out.println("title of new document: "+doc.gettitle()); // add document repository objectconnection con = repository.

java - Astar boundary checking -

so have astar program running , runs 4 outta 6 times, gives 2 different array out of bound errors @ times. i think issue of boundary checking, think have boundary checks right. can point out issue is? public class myastar extends astar { public myastar(int r, int c) { super(r,c); } static final int new =0; static final int interior =1; static final int frontier =2; int[][] status = new int[rows][cols]; //initialize new matrix of 0s--keep track of status of node public coord search(int sy, int sx, int ty, int tx) { coord start = new coord (sy, sx); start.dist = 0; start.cost=0; coord current = null; //create frontier heap pheap<coord> frontier = new pheap<coord>(new coord[1000]); //insert start frontier frontier.insert(start); //status status [sy][sx] = frontier; //boolean value of when stop while boolean stop = false; //cost

java - Different Enum method parameters -

i have come across case need make design decision (not program itself, learning others in situation, best @ though going api). have enum class: public enum type { captain(2), // use calcmorale never other leader(5), // use calcmorale never other partier(80); // use calcmorale2 never other int calcmorale(int inmorale) { return inmorale * (100 + morale) / 100; } int calcmorale2(int inmorale, int teamcount) { return inmorale + morale * teamcount; } int morale; private type(int amor) { morale = amor; } } there class character holds 1 of these enums , 1 passing in parameters. the problem commented, want enums use methods inside enum class. leader adds 5 percent team morale, partier adds 80 each member inside party requiring parameter. solve problem few ways, know general consensus of community on how they'd go it. i could: make programmers responsibility call right method. (this sounds wro

php - How to find for a string in html code -

i trying find string html section example <div class="container" data-id="youtube" style="height:100%;width:100%;border:none;"> <div class="inner"></div> generally find string using if(strpos($string,"youtube") !== false) but sample test trying store html code php variable $string="<div class="container" data-id="youtube" style="height:100%;width:100%;border:none;"> <div class="inner"></div>"; when try find youtube in $string , returns false(does not exist) can me find string in html code thank you i made simple test you....it's working on localhost: <?php $string="<div class='container' data-id='youtube' style='height:100%;width:100%;border:none;'><div class='inner'></div>"; $search = "youtube"; if(strpos($string, $search) !==

joomla3.0 - Joomla API 12.1 Cli JTable returns false when trying to instantiate the Content Table -

i have found several examples online, seem use older api versions of joomla , not work 12.1 api. i'm sure simple i'm missing, cannot seem find it. // bootstrapping stuff here require_once( "../configuration.php" ); $kconfig = new jconfig; $kdb = jdatabase::getinstance( array( 'driver' => $kconfig->dbtype, 'host' => $kconfig->host, 'user' => $kconfig->user, 'password' => $kconfig->password, 'database' => $kconfig->db, 'prefix' => $kconfig->dbprefix ) ); jfactory::$config = new jregistry( $kconfig ); $kpage = new cpage( root_dir."/index.html" ); echo "injecting: ". $kpage->m_strtitle."\n"; echo "\t". $kpage->m_strkeywords."\n"; echo "\t". $kpage->m_strdesc."\n"; $table = jtable::getinstance( 'content', 'jtable', array( 'dbo&#

How to use Google API to Query Index folders using Python -

i new programming , learning python. wanted figure if there way query/traverse/search inside index folder returned google query using python. let me try give example: suppose based on query, google returns me link index folder ftp ://path/to/index/directory i want traverse files available @ index , fetch me specific file. is possible google search api? thank you

Find consecutive diphthongs in MySQL -

i have list of addresses in shops database. lot of these fake; consist of strings dfdfdfsd@somewhere.com , qwsdrtghj@somewherelse.com . in other words: @ least 5 dipthongs in row. how can search such string in sql query ? basically: diphthong followed diphthong , , 5 times . it looks you're doubling on of consonants determine dipthong. example: dfdfdfsd if count df , df , df , sd separate dipthongs, total four. looks may overlapping: dfdfdfsd ^df ^fd ^df ^fd ^df ^fs ^sd that gives total of 7 dipthongs. i don't know how match that, how checking if there 5 (or more) consonants in row? it: email rlike '[b-df-hj-np-twxz]{5,}' if don't want treat y vowel, add string above. put between x , z readability, or @ least don't put after 1 of hyphens or you'll break expression. likewise, if 6 (or 7 or 8) consonants in row tipping point you're after, adjust 5 in expression above accordingly.

xslt - xsl ancestor-or-self not return result -

i have problem when try for-each every parent of node. have xml this: <item name="news" id="77"> <items> <item id="102" /> <item id="103" /> </items> </item> <item id="86"> <items> <item id="122"> <items> <item id="6" /> <item id="9" /> </items> </item> <item id="12"> <items> <item id="13" /> <item id="18" /> <item id="19" /> </items> </item> </items> </item> <item name="sitemap" id="88" /> and in template try this: <xsl:template name="render"> <xsl:param name="length" /> <xsl:param name="item" /> <xsl:for-each select="ancest

c# - SerialPort not writing data with long strings - FIXED -

i writing program writes channel urls , channel names device. i'm trying write channel urls length of 254. shorter urls (i haven't found threshold yet) work. makes more strange channel names 16 characters long, , these write when channel urls shorter. i have following code works: (int = 0; < numberofchannels; i++) { string hexstring = string.format("{0:x1}", i); serialport.writeline("channel 2 " + hexstring + " " + channelurls[i]); system.threading.thread.sleep(1000); serialport.writeline("channel 1 " + hexstring + " " + channelnames[i]); system.threading.thread.sleep(1000); } however, not want have code sleep 2seconds writing 1 channel. question: how long strings written through serialport without waiting 2 seconds? this not work: (int = 0; < numberofchannels; i++)

Use Django subdomains to switch out the base template -

i add "dev" subdomain django site publicly testing experimental layouts. of these experiments operate on base.html template. (for example, might try new css file coupled more fluid containers.) @ moment, alternate template lives in base_alt.html file. i have middleware set request object has correct subdomain property, , i'm using django.core.context_processors.request context processor pass property template itself. cannot decide on correct place put logic swap out base file. here ideas: logic in each template inherits base.html : {% ifequal request.subdomain "dev" %} {% extends "base_alt.html" %} {% else %} {% extends "base.html" %} {% endifequal %} this doesn't work, 1 thing. assume i'm doing stupid wrong. seems terrible solution -- @ least dozen page-level templates inherit base. the other mediocre idea had put both base templates in base.html giant "if" statement. surely there's better

java - How to do Encryption and Decryption of a File? -

i use cipheroutputstream encryption , decryption file in java, input file > 117 byte cannot encryption. use rsa algorithm public key lenght 1024 byte. cipher.init(cipher.encrypt_mode, seckey); string cleartextfile = "cleartext.txt"; string ciphertextfile = "ciphertextsymm.txt"; fileinputstream fis = new fileinputstream(cleartextfile); fileoutputstream fos = new fileoutputstream(ciphertextfile); cipheroutputstream cos = new cipheroutputstream(fos, cipher); byte[] block = new byte[8]; int i; while ((i = fis.read(block)) != -1) { cos.write(block, 0, i); } cos.close(); how encryption input file length > 117 byte? you cannot encrypt file using rsa because rsa (well, more precise, implementation of rsa in java) not let encrypt more data length of key. 1024 bits key, can encrypt 1024 bits 128 bytes (actually bit less padding reasons). in cases, it bad practice encrypt large piece of data using public-key algorithm (asymmetric cryptogra

php - Check if date is in range of multiple date ranges -

i have list of certificates have expiry date. trying show different colours depending on how far away expiry. need show red if expires in less 30 days (or has expired), amber if date between 60 , 30 days away , green if more 60 days. far have started working on +30 days part. far have following <?php foreach($company_certificates $certificates): $startdate = date('d-m-y'); $onemonth = date('d-m-y', strtotime('+30 days')); ?> <tr> <td><?php echo $certificates->username ?></td> <td><?php echo $certificates->certificate ?></td> <td><?php echo $certificates->expiry_date ?></td> <td><?php //$onemonth = date($certificates->expiry_date, strtotime('-30 days')); if ($date >= $certificates->expiry_date) { $expiry = '2'; //expired } else { if($certificates->expiry_date > $onemonth && $st

python - Can't get django urls to work -

i've got simple django setup in have 1 app called ' lists '. want http://127.0.0.1:8000/lists show app. changed main urls.py following: from django.conf.urls import patterns, include, url django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^lists/', include('lists.urls')), url(r'^admin/', include(admin.site.urls)), ) and changed urls.py resides in lists-folder (my app called lists) following: from django.conf.urls import patterns, url lists import views urlpatterns = patterns( url(r'^$', views.index, name='index') ) as far know following instructions in the django tutorial well, when visit http://127.0.0.1:8000/lists ( without trailing slash) gives me following error: page not found (404) request method: request url: http://127.0.0.1:8000/lists using urlconf defined in companylists.urls, django tried these url patterns, in order: ^lists/ ^admin/ cu

javascript - strange behavior on manipulating DOM with drag and drop -

i'm using html5 drag , drop set values div dropped, there strange behavior can't understand nor find solution. for example if add elements on position 1,6,11,16 (on diagonal), you'll see on position 2,3,4 div , input gets deleted inside td . why's that? and example if try clone element position 1 position 2 class gets value " typea-1 " example; of course there counter there, id , not class too, why class gets counter value? here code on jsfiddle http://jsfiddle.net/shlw3/1/ thanks var counter = 1; function allowdrop(ev) { ev.preventdefault(); } function drag(ev) { ev.datatransfer.setdata("text",ev.target.id); } function clone(ev) { ev.preventdefault(); var data = ev.datatransfer.getdata("text"); var original = document.getelementbyid(data); var set = document.getelementbyid("empty"); set.firstelementchild.setattribute("value", data); set.setattribute("id", dat

php - I am trying to rerwrite this as a mysqli query but I keep getting an error -

i wrote query in php , mysql , works fine , returns data trying re-write mysqli function. this come 500 error file. if (mysqli_connect_errno()) { printf("could not talk database: ", mysqli_connect_error()); exit(); } $query("sql query works fine"); $data = array(); if ($result = $con->query($query)) { $tempdata = array(); while ($row = $result->fetch_object()) { $tempdata = $row; array_push($data, $tempdata); } echo json_encode($myarray); } /* free result set */ $result->close(); $con->close(); first problem see trying json_encode variable not exist. change $myarray $tempdata ? if debugging turned off error message go error_log saying undefined variable $myarray

java - How to represent a legacy database using Hibernate? -

i have follow legacy database structure , content: order parameter value -------------------------------- 1 user_login user 1 user_password 123456 1 user_level basic 2 user_login admin 2 user_password s3k42k 2 user_level advanced i represent below , utilize entity called 'user' can abstract complexity of legacy structure: id user password level ------------------------------- 1 user 123456 basic 2 admin s3k42k advanced i got using view in database, couldnt update using view. there way represent legacy structure using hibernate can update too? your best approach normalize table. make things easier in long run. 1 thing try not option, create table called user holds @ least primary key , id of users information in parameter table. allow treat relationship one-to-many , map hibernate. example following: note might have mapping wrong did off of top of head illustrate point. @en

datepicker Bootstrap and cakephp -

i'm using datepicker boostrap in cakephp application ( http://www.eyecon.ro/bootstrap-datepicker/ ) but, when try save date (to post) never date post. <?php echo $this->form->create(false); ?> <div class="input-append date pull-right" id="dp3" data-date-format="dd-mm-yyyy"> <input class="span2" size="16" type="text" value="data registo" readonly> <span class="add-on"><i class="icon-th"></i></span> </div> (...) javascript: (function($) { $(document).ready(function() { $("#dp3").datepicker() .on('show', function(ev) { var today = new date(); var t = today.getdate() + "-" + (today.getmonth() + 1) + "-" + today.getfullyear(); $('#dp3').data({date: t}).datepicker('update'); }); $('#timepi

delphi - Why i get NAN value when storing mmioRead result in double? -

why nan value when trying read .wav file , directly store sample data in double ? before thinking using store sample data in smallint , convert double dividing 32768.0 (there no nan value) later on got accuracy problem rounding off when converting wav file. setlength(buf, ckidata.cksize); mmioread(hmmio, pansichar(buf), ckidata.cksize); where buf array of double. weren't allowed directly storing array of double? if raw sample data 64-bit doubles (what audio format using that?), yes, can directly read array of doubles, eg: var buf: array of double; setlength(buf, ckidata.cksize div sizeof(double)); mmioread(hmmio, pansichar(buf), length(buf) * sizeof(double)); however, audio formats not use doubles, have first read suitable buffer using correct data type (smallint 16-bit pcm, example), convert samples afterwards.

java - Trying to use new package -

basically i've downloaded package worldwind jdk allows rendering of 3ds models. however, life of me, i've been unable use of these files using standard imports, , googlefoo failing pretty hard in coming way use them. import on primary renderer file this import gov.nasa.worldwind.movable; import gov.nasa.worldwind.geom.angle; import gov.nasa.worldwind.geom.latlon; import gov.nasa.worldwind.geom.position; import gov.nasa.worldwind.geom.quaternion; import gov.nasa.worldwind.geom.vec4; import gov.nasa.worldwind.globes.globe; import gov.nasa.worldwind.render.drawcontext; import gov.nasa.worldwind.render.renderable; import gov.nasa.worldwind.util.logging; import javax.media.opengl.gl; //problems reside these imports import net.java.joglutils.model.modelfactory; import net.java.joglutils.model.examples.displaylistrenderer; import net.java.joglutils.model.geometry.model; public class movable3dmodel implements renderable, movable{ } the error when trying use them the

ruby on rails 3.2 - How to write a function for the day AFTER Thanksgiving? Holiday gem, YAML files -

i'm writing app tracks time-off via date ranges, , part of calculations make sure exclude weekends , holidays. in order keep track of holidays i'm using forked version of holidays gem( https://github.com/alexdunae/holidays ), editing recognize holidays company recognizes. fork: ( https://github.com/rclark4/holidays ). so far has worked fine me, i've run problem day after thanksgiving, addition original gem. excerpt of yaml file looks like: 11: - name: thanksgiving week: 4 regions: [us] wday: 4 - name: day after thanksgiving week: 4 regions: [us] wday: 5 while works 2008-2012, doesn't work in 2013 (and won't every 6-7 years), because november starts on friday, right it's saying day after thanksgiving week before is. i've tried @ syntax of other holidays see if there precedent holidays happened day after floating holiday, couldn't find 1 (the closest thing found friday easter, easter has it's own separate method

Django admin inline: select all for delete? -

in django admin inline forms, there checkboxes deleting individual inline objects. there way enable selecting of them @ once deletion? here's solution worked out: in templates/admin/edit_inline/tabular.html {% if inline_admin_formset.formset.can_delete %}<th>{% trans "delete?" %}&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" class="selectall_checkbox"/></th>{% endif %} and <script type="text/javascript"> $('.selectall_checkbox').click(function(e) { $(e.target).closest('table').find(':checkbox').filter(function () { return /delete/.test(this.name); }).each(function () { this.checked = e.target.checked; }); }); </script>

c# - Perform postback on ASP.Net control dynamically added by jQuery -

i have website running under asp.net. has number of ascx controls each represent different page. master page call loadcontrol() on ascx , add panel. ascx page_load() hook personal save function event on page "save" button on master page right thing. working. i trying more dynamic , use jquery more , things more on client side. end, experimenting loading ascx controls dynamically. goal able minimal changes each ascx. have page, following contents (edited brevity): <head> <script language="javascript" type="text/javascript"> function documentmetadataload() { jquery.ajax({ type: "get", //get url: "jqueryhandler.ashx?operation=loadpage&name=/usercontrols/documentmanagment/documentmetadata.ascx", datatype: "html", cache: false, success: function (response) { $('#property_tab').html(response); }, error: function () { debugger

html - How can I stop my submenu from disappearing while hovering between spaced submenu items? -

i have css menu submenu, , each submenu list item has 1px space between them. problem occurs in ie, unless move cursor quickly, submenu disappear while hovering between 2 submenu items (due 1px space). how stop happening while keeping 1px spaces? <nav id="menu" class="sixteen columns"> <ul id="nav"> <li><a href="#">home</a> <ul> <li><a href="#">drop 1</a></li> <li><a href="#">drop 1</a></li> <li><a href="#">drop 1</a></li> </ul> </li> <li><a href="#">services</a></li> <li><a href="#">contact us</a></li> </ul> </nav> #menu { position: relative; z-index: 999; } ul#nav { margin: 0; padding:

php - Form With Unlimited Fields -

Image
i have form has [add fields] option making possible add virtually unlimited item numbers , descriptions. these fields named: item[] , desc[] (brackets arrays). my question is, how submit information php , mysql each row (item , description) submitted it's own row in database? i've tried multiple methods submitting item[0] , desc[0] no avail :( thanks of in advance! edit: below i've been trying use... (sorry, not great arrays...) $count = 0 foreach ($_post['item'] $item) { $query = "insert items (item, desc) values ('" . $item[$count] . "', '" . $_post['desc'][$count] . "')"; // script simplified quite complex. if ($query_result) { $count++; } } you can loop through 1 of input field using foreach loop , access other fields. foreach($_post['item'] $key => $item){ //your code $desc = $_post['desc'][$key]; } edit : per code script

angularjs - Not able to change the location path -

redirecting not functional in below code. console.log() works fine, url doesn't change. needless say, i'm confused why. i've changed url section of application , works great. angular.module('workstation.process.approval', [ /* dependencies */ 'workstation.services' ]). config(['$routeprovider', function($routeprovider) { /* url mappings */ $routeprovider. when('/approval', {templateurl: 'partials/loading.htm', controller: 'approvalctrl'}). when('/approval/dashboard', {templateurl: 'partials/approval/dashboard.htm', controller: 'approvalctrl'}) }]). controller('approvalctrl', ['$scope', '$cookiestore', 'workflowprocessservice', 'socketurl', '$location', function ($scope, $cookiestore, workflowprocessservice, socketurl, $location) { var socket = portal.open(socket

robotframework - Is it possible to have a variable span multiple lines in robot framework -

i have long regex put variable test with. i'd able put on multiple lines it's not unreadable. saw multiple lines documentation tag. when try formatting, robot seems think list. there way in robot framework? ${example_regex} = '(?m)setting ip address [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\nsetting mac address [0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}\nsetting ip forwarding kernel options' would able write: ${example_regex} '(?m)setting ip address [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\n setting mac address [0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}\n setting ip forwarding kernel options' unfortunately, robotframework doesn't directly support multiline literal strings. however, can same effect using catenate keyword in test case or keyword join data spread across multiple cells. sure escape backslashes, , set separator

database - Multiple triggers don't work on firebird -

create trigger tr_bufile_fileid bufiles before insert begin if (new.fileid null) new.fileid = gen_id(fileid_generator, 1); end create trigger tr_bufile_insert bufiles after insert begin update miscitems set totalsize = totalsize + new.bufilesize; end create trigger tr_bufile_update bufiles after update begin if (new.deletiontime < '9223372036854775807' , new.deletiontime != old.deletiontime) update miscitems set totalsize = totalsize - old.bufilesize; end i created 3 triggers on firebird database. application use odbc connection operate on database. problem second trigger (tr_bufile_insert) doesn't work if make insertion on bufiles table. trigger works if test them in sql manager interbase/firebird. any appreciated. thanks, shiping your triggers seems ok . afraid connecting db application . please check . please check trigger status "active"

dynamics crm 2011 - An error occurred during pricing of a detail line item -

Image
i trying add salesorder ms dynamics online 2011. although line items come through, order fails calculate total: i notice extended amount never calculated . when click lock pricing, amounts calculate. lockpricing read property in code. here code: http://pastebin.com/c6cqxxmx

Matlab - How to measure the dispersion of black in a binary image? -

i comparing rgb images of small colored granules spilled randomly on white backdrop. current method involves importing image matlab, converting binary image, setting threshold , forcing pixels above white. next, calculating percentage of pixels black. in comparing images 1 another, measurement of % black pixels great; however, not take account how granules dispersed. although % black 2 different images may identical, images may far being alike. example, assume have 2 images compare. both show % black pixels of 15%. in 1 picture, black pixels randomly distributed throughout image. in other, clump of black pixels in 1 corner , sparse in rest of image. what can use in matlab numerically quantify how "spread out" black pixels purpose of comparing 2 images? i haven't been able wrap brain around 1 yet, , need help. thoughts/answers appreciated. found answer similar problem -> https://stats.stackexchange.com/a/13274 basically, use average distance

python - How to convert H264 RTP stream from PCAP to a playable video file -

i have captured stream of h264 in pcap files , trying create media files data. container not important (avi,mp4,mkv,…). when i'm using videosnarf or rtpbreak (combined python code adds 00 00 00 01 before each packet) , ffmpeg, result ok if input frame rate constant (or near constant). however, when input vfr, result plays fast (and on same rare cases slow). example: videosnarf -i captured.pcap –c ffmpeg -i h264-media-1.264 output.avi after doing investigation of issue believe since videosnarf (and rtpbreak) removing rtp header packets, timestamp lost , ffmpeg referring input data cbr. i know if there way pass (on separate file?) timestamps vector or other information ffmpeg result created correctly? is there other way can take data out of pcap file , play or convert , play it? since work done in python, suggestion of libraries/modules can work (even if requires codding) welcome well. note: work done offline, no limitations on output. can cbr/vbr, playa

java - key exchange algorithm with optional parties -

i need generate secret key (or password) agreement of multiple parties out of parties optional. for example, mr. a, b, c & d members can agreement , out of atleast 2 agreements required generate secret. secret should same such key agreements. i went through diffie-hellman algorithm requires keys. looking @ 1 private key , n public key type of key exchange algorithm. please suggest algorithms have behavior. all public key cryptosystems know of uses 1-1 key relationship. it's not possible standard algorithms available. what looking threshold cryptosystem or shamir's secret sharing .

How to programmatically check if PC has internet connectivity using Python and/or Ruby? -

i have scripts in both python , ruby run days @ time , rely on internet go domains , collect data. there way implement network connectivity check script pause/retry iterations of loop if there no connectivity , restart when there connectivity? there may more elegant solution, i'd this: require 'open-uri' def internet_connectivity? open('http://google.com') true rescue => ex false end

php - direct page access prevention -

on site have 2 pages, simple password protected page called login.php , main webpage called index.php i trying prevent users directly accessing 'index.php' if visitor tried access index.php directly, redirect login.php if visitor entered correct password, allow access index.php file. currently, i'm stuck in loop. when try access index.php directly, redirected login.php - ok when enter password, click enter, i'm sent index.php looped `login.php' page how prevent loop please // index.php <?php if (!isset($include_allowed)){ die("<meta http-equiv='refresh'content='0;url=\"http://www.myweb.com/login.php'>"); } ?> - // login.php <?php $include_allowed = true; ?> many (sorry if confusing) please note, there no username, basic password form checks password matches variable before sending 'index.php' page if ($pass == "mypassword") { there to

android - Set a Margin between two buttons programmatically from a linearlayout -

Image
how can set margin of 20dp between button "regler" , "decommender" programmatically. here workings linearlayout lytmain = new linearlayout(mcontex); lytmain.setorientation(linearlayout.vertical); linearlayout lytdate = new linearlayout(mcontex); linearlayout lytbutton = new linearlayout(mcontex); lytbutton.setbackgroundresource(r.color.black); lytbutton.setbackgroundresource(r.color.black); lytdate.setbackgroundresource(r.color.black); lytmain.setbackgroundresource(r.color.black); button btnset = new button(mcontex); button btncancel = new button(mcontex); btncancel.setshadowlayer(2, 1, 1, r.color.black); btnset.setshadowlayer(2, 1, 1, r.color.black); btnset.setbackgroundresource(r.drawable.black_button); btncancel.setbackgroundresource(r.drawable.black_button); btnset.settextcolor(mc

postgresql - SQL subquery sort -

could 1 kind assist me following: i have query results in 2 columns 1 being straight ( columna ) table while other generated subquery ( columnb ). if sort (i.e. order by) on columnb slower response when doing same on columna (50+ times). there way speed sort on columnb in order come close speeds achieved when sorting columna ? note: engine postgres update: query looks similar to: select columna, array_to_string(array(select ... tableb ...), '%') columnb tablea ... order columna any advice appreciated. update #2 : solved doing sort in new query , feeding results main query (using statement select partial number of rows instead of whole set gave me performance needed). replied. in query select columna, array_to_string(array(select ... tableb ...), '%') columnb tablea ... order columna operations on columnb can't take advantage of index. not that, sort have deal columns width of many concatenated rows. your best bet reconsider why

Can I use Entity Framework on Windows Phone 8 -

is possible use entity framework save data sql ce database in isolated storage on windows phone 8? when try , add reference ef 5 using nuget error: "failed add reference 'system.data.entity'. please make sure in global assembly cache." any ideas? just tested vs2013 , ef6 still same problem. but supported (although limited functionality) linq sql http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202872(v=vs.105).aspx at least same orm style of data access.

dynamic - checking dynamically named selects using jquery -

how can use jquery value of dynamically named select? i have several (no exact number) of selects populated this: <?php ($i = 0; $i < count($manifest); $i++) echo '<select id="headercolumn_' . $i . '"> <option value="">-- column header --</option> <option value="1">option 1</option> <option value="2">option 2</option> <option value="3">option 3</option> <option value="4">option 4</option> </select>'; ?> later on, have button includes onclick function. when function called, pass how many selects created. now, need value of selects. tried this: for (var = 0; < valuepassedintofunction; i++) { var thisvalue = $("#headercolumn_" + i).val(); alert("#headercolumn_" + + " = " + thisvalue); } but when

encryption - Fast RC4 cipher stream for Python? -

i'm trying write app needs large numbers of cryptographic strength pseudorandom bytes. the rc4 cipher ideal this; it's lightweight , simple understand conceptually. so, got spec , wrote rc4 algorithm in python. it works expected, but, it's slow molasses. on core i7 2.2ghz, can 1mb/sec out of algorithm. clearly interpreted nature of python not best suited sort of task. problem i'm not versed in c coding - best i've done c hello world stuff , experiments file reading , writing. either way, not enough c use python-c apis. i know .net/c#, , wrote same algorithm in windows on c#, , able on 60mb/sec out of it. .net's clr lot more optimized. but, target platform python app unix/linux. ideally, don't want have go through tons of middle-layers optimized rc4 cipher python app. since rc4 depends on state, ideally i'd class (that's how did python-only implementation.) so, here's small snippet of want able do: rc4 = rc4encrypter() rc4.seed(m