Posts

Showing posts from May, 2011

html - Firefox text-indent bug on overflow hidden -

actually have progress bar use text-indent put text in middle of progress. all work fine in chrome , ie, isn't in firefox. (yeap, can't believe it) check difference in chrome , firefox. http://jsfiddle.net/zgyaz/1/ animated version http://jsfiddle.net/zgyaz/19/ html <div class="container"> <div class="bars bar1">sametext</div> <div class="bars bar2">sametext</div> </div> css .container{ border:1px solid #09c; height: 20px; width: 100%; position: relative; } .container .bars{ text-indent: 45%; position: absolute; top:0; font-family: arial; color: #09c; } .container .bar2{ background-color: #09c; width: 50%; color: #fff; overflow: hidden; } width in bar2 , text-indent dynamic vars show expected result on fill progress bar. this looks unreported gecko bug. filed https://bugzilla.mozilla.org/show_bug.cgi?id=908706 as wor

explode - i need fix select form on php code -

hello need fix problem on php code. when write value name="" , id="" aren't found. here's code: <?php $tipos= $eachoption['option_value']; $categorias=''; $cats = explode(",",$tipos); echo "<select name=\"option_<?php echo $eachoption['option_id'];?>[]\" id=\"<?php echo $_post['option_'.$eachoption['option_id']][$i];?>\">"; foreach($cats $cat){ $cat = trim($cat); $categorias .= "<option>". $cat ."</option>"; } echo $categorias; echo "</select>"; ?> thanks! think maybe " or ' inside echo. your php syntax incorrect. cannot embed php-within-php. e.g. <?php $foo = "<?php echo 'bar' ?>"; will not execute echo call. assigning literal characters < , ? , p , etc... string. since you're using double

c# - How to add style to an exisiting table in docx using openXML SDK2.0 -

i working on project, involves creating data sheet. have managed create tables in docx file following code provided msdn, when try apply style (eg. border set none, shading, cell width, etc.) table created, wont append on it. so assume have use table.removeallchildren append new style . if so, entire table removed , have re-create table. there must better way of doing it. please advise. the following sample code iihave, 1 cell table. shaded dark-blue, trying remove table border, set cell width , modify text. public void docheadertableval(string filelocation, string replacingval, int tablenum, int rownum, int cellnum) //replace value { try { using (var doc = wordprocessingdocument.open(filelocation, true)) { // find first table in document. table table = doc.maindocumentpart.document.body.elements<table>().elementat(tablenum); tableproperties props = new

ipad - How set up editing in iOS application like contacts app -

Image
my designer giving me looks similar ipad contacts app. doesn't seem standard, though. have thought have found more info on searches haven't brought much, apologize if i've missed it. want have green "+" button add item, expanding cell enter data item when tapped (see "add new address" cell in 1st attached image below), in 2nd image cell expanded address fields. the final question relates seems standard table editing behavior, i'm not sure how fit context. delete icon, getting rotate when tapped , "delete" button show in cell. asked earlier, how delete icon show side of cell rather within , how show cells , not of them? see final screenshot below. any appreciated. thanks! sounds complicated. why not leverage apple's abpersonviewcontroller display , edit address book contact?

python - Turning a list of strings into the names of tables -

i'm trying generate tables within "for" loop. i'm stuck on need allow string in tablenames name of table. tablenames = ['t_10', 't_20', 't_30', 't_40', 't_50', 't_60', 't_70', 't_80', 't_90', 't_100'] firstrow = ['10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%', '100%'] t, r, in zip(tablenames, firstrow): t = [[r, '']] here's ended doing - know, it's not pretty (i know there's way generate number of spaces wanted...it not cooperating...also, cond1 , cond0 lists odd....) t_10 = [['10%', '', '', '', '', '', '', '', '', '','','','']] t_20 = [['20%', '', '', '', '', '', '', '', '', ''

How to tell MODX wayFinder to detect the resource ID it is currently on -

i new wayfinder have been working bit , has worked great me, need little more dynamic i'm not sure how do. i have set of 5 pages in website , each page has side menu, each menu 5 resources different i need wayfinder detect current id , display appropriate menu i've tried couple things nothign can work: [[!if? &subject= [[*28]] &then= [[wayfinder? &startid= 27 &excludedocs= 28,29,30,31,32,33,89 ]] ]] so need if id = 28 display menu if id = 29 display 1 , on. i've tried &idis= 28 , couple other variations couldn't find me out on else have ideas how make work? thank you. you can use output filters conditional calls. documentation them here you code looks this: [[*id:is=`28`:then=`[[wayfinder? &startid=27&excludedocs=28,29,30,31,32,33,89]]`:else=``]]

Formatting multidimensional arrays in PHP for charting -

i beginner @ php , struggling graph data filemaker database. because filemaker not support sql has own php api, cannot use sql language group , subtotal data etc. i trying graph aggregate numbers on sales peoples activities on dashboard in realtime, using possibly highchart or similar. main problem not sure how should data php suitable format charting package. i want make sorted stacked bar chart out of this, showing total number of activities each user. want make dynamic can poll database , handle number of sales people , number of different activities. i have built , populated php array looking (multidimensional array usernames , activity names , count): array ( [fremin] => array ( [sent letter/email] => 2 [booked meeting] => 0 [call] => 0 [call na/lv] => 0 [walkby] => 0 ) [heleli] => array ( [sent letter/email] => 4 [booked meeting] => 1 [call] => 7 [call na/lv] => 13 [walkby] => 2 ) ) and json_encode gives this: "fremin":{

windows installer - MsiDatabaseOpenView returns 6 (ERROR_INVALID_HANDLE) -

i have basic msi project in installshield 2013. trying dynamically insert items in combobox using installscript custom action. stuck before inserting items. when try open view error_invalid_handle. appreciate advice on missing. function func(hmsi) hwnd hdatabase; hwnd hviewlist; begin hdatabase = msigetactivedatabase(hmsi); msidatabaseopenview(hdatabase, "select * `combobox` `property`='prop'", hviewlist); end; msidatabaseopenview keeps returning 6 (error_invalid_handle) when use either hdatabase or hmsi first parameter.

ibm mobilefirst - dojox/calendar/Calendar.js 404 not found in worklight hybrid application -

i have app trying use dojox.calendar.calendar in worklight 5.0.6 hybrid app using dojo. i've added calendar-layer.js.compressed.js build-dojo.xml file both copy , dojo.resources.layers. <patternset id="dojo.resources.layers"> <include name="dojo/dojo.js.compressed.js"/> <include name="dojo/core-web-layer.js.compressed.js"/> <include name="dojo/calendar-layer.js.compressed.js"/> </patternset> <copy todir="${build.dir}"> <fileset dir="${dojo.root}"> <include name="dojo/mobile-compat-layer.js.compressed.js"/> <include name="dojo/mobile-ui-layer.js.compressed.js"/> <include name="dojo/calendar-layer.js.compressed.js"/> </fileset> <mapper refid="dojo.resources.mapper"/> </copy> in main html f

iOS Ad Hoc installation failing -

i'm getting following error when try install app via testflightapp.com. "unable download application. "helloworld" not installed @ time. i've tried installing via itunes , apple configurator. when first got error, thought might due apple's developer program being down few weeks back, regenerated certificates using code signing request on laptop, rebuilt provisioning profiles. i deleted profiles iphone, , xcode, , deleted testflight phone. then archived app, uploaded test flight, gave permission devices in profile, , sent notification emails download link. when try download, progress bar gets way end error pops up. see in console during installation (from iphone configuration utility): springboard[67] <warning>: killing com.helloworldapp app installation installd[53] <error>: 0x2c6000 handle_install: install of "/var/mobile/media/downloads/-2429066128781955904/-410631401396950200" requested itunesstored install

c++ - FFTW : how to prevent breaking aliasing rules? -

i have code uses std::complex<double> type. fftw manual : if have variable complex<double> *x , can pass directly fftw via reinterpret_cast<fftw_complex*>(x) . however, when in code : tmp_spectrum = reinterpret_cast<std::complex<double>*>(fftw_alloc_complex(conf.spectrumsize())); plan_bw_temp = fftw_plan_dft_c2r_1d(conf.fftsize(), reinterpret_cast<fftw_complex*>(tmp_spectrum), tmp_out, fftw_estimate); i dereferencing type-punned pointer might break strict-aliasing rules [-wstrict-aliasing] . how solve warning ? ! you have 3 options here: just create fftw_complex when need one: fftw_plan_dft_c2r_1d(conf.fftsize(), fftw_complex(tmp_spectrum.real(), tmp_spectrum.imag()), tmp_out, fftw_estimate); don't use c++ language's complex type in code, , use fftw_complex type. disable strict-alias optimizations , enforcement in appropriate translation unit -fno-strict-aliasing . silencing warning not safe might result in

javascript - no triggering on click event -

this simple intersting issue. suppose have 2 sections of respective class .toggle0 , .toggle1 , suppose want display .toggle0 , hide .toggle1 when clicking on tag .footer0 , , vice-versa : want display .toggle1 , hide .toggle0 when clicking on tag .footer1 . code works correctly $('.toggle1').hide(); var i=0; $(".footer"+i+"").click(function(){ $(".toggle"+(i+1) %2+"").hide(); $(".toggle"+i+"").show(); }); var j=1; $(".footer"+j+"").click(function(){ $(".toggle"+(j+1) %2+"").hide(); $(".toggle"+j+"").show(); }); but doesn't work in sense nothing happens on click event for(var i=0;i<2;i++){ $(".footer"+i+"").click(function(){ $(".toggle"+(i+1) %2+"").hide(); $(".toggle"+i+"").show(); }); }

Get months from datefield in django -

if have datefield in django model, how can possible months values model objects? if have object1 date = 22.01.2013 , object2 date = 23.05.2013, need list of months [01, 05] or [1, 5] you can this: months = [i.month in mymodel.objects.values_list('date', flat=true)]

ios - didUpdateLocations and didUpdateToLocation -

supporting both ios 5 , 6, 1 should call didupdatelocations didupdatetolocation . how make call , build locations array? code sample, please? thank you. you don't call routines. system, corelocation specifically, calls them.

Pass argument to bash script with expect and SSH -

i trying write remote control script can grep key words when tailing. $ ./myscript.sh somekeyword i expect log on remote machine , run $ tail -f /tmp/log/mylog.log | grep "somekeyword" here code: #!/usr/bin/expect eval spawn ssh -ostricthostkeychecking=no -ocheckhostip=no root@myhost #use correct prompt set prompt ":|#|\\\$" interact -o -nobuffer -re $prompt return send "mypassowrd\r" interact -o -nobuffer -re $prompt return send "tail -f \/tmp\/log\/mylog.log | grep \"$1\"\r" interact can me? thanks in advance! instead of passing simulating interactive session would: setup ssh key based authentication - removes need of entering password then use: ssh root@kroute "logread \| grep asd"

convert number to formatted string in python with prefix 0s -

i want convert number in python 3 character string, prefix 0s. example: 8 = "008" 12 = "012" 6 = "006" thanks just use: format(number, '03')

linux - what is hex version of a command , what does it mean in reality , how is this done -

i have noticed command in form of hex characters , says hex version of command (linux) , mean hex version , how can convert human readable form . of know : \ : escape sequence x : stands hex the command listed below... "\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68" "\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99" "\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7" "\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56" "\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31" "\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69" "\x6e\x2f\x73\x68\x00\x2d\x63\x00" but how can convert original command in english "xxxxxxxx " . i took binary , ran through hexdump -vc , objdump : $ objdump -b binary -m i386 -d output output: file format binary disassembly of section .data: 00000000 <.data>: 0: eb 3e jmp 0x40 2: 5b

python - Is there another way to avoid duplication of large hashable objects? -

i processing text , have need store large sequences of hashable objects - strings, tuples of words, etc. i've been thinking of using hash function provide simple store , retrieve class first approach possible single hash key might resolve more 1 item. given add function takes return value of add argument cannot know item in list return. class hashstore: def __init__(self): self.uniques = {} def add(self, big_hashable): hash_value = hash(big_hashable) if hash_value not in self.uniques: self.uniques[hash_value] = [big_hashable] elif big_hashable not in self.uniques[hash_value]: self.uniques[hash_value].append(big_hashable) return hash_value another approach ends assuring there single mapping each unique hashable item. class singlestore: def __init__(self): self.uniques = {} self.indexed = {} self.index = 0 def add(self, big_hashable): if big_hashable not in sel

Email templates with ASP.NET MVC 2, .NET 3.5 and Visual Studio 2008? -

i trying avoid using stringbuilder generate e-mails , hoping find solution dynamically create e-mail templates using: .net 3.5 asp.net mvc 2 visual studio 2008 i have searched, seem require .net 4 or asp.net mvc 3+. there support requirements?

listview - onitemClickListener is not working above android 4.0 -

i have list view in have added onitemclicklistener. problem that, onclicklistener working android 2.2 , 2.3 not working above android 4. can please tell me why happening , can make work ?? listview remindview= (listview)findviewbyid(r.id.addreminderview); remindview.setonitemclicklistener(new listview.onitemclicklistener(){ @override public void onitemclick(adapterview<?> arg, view v, int position,long id) { intent = new intent(reminderview.this,singlereminder.class); startactivity(i); } });

Powershell -command's exit code is not the same as a script's exit code -

i need run script powershell -command "& scriptname", , if exit code got powershell same exit code script returned. unfortunately, powershell returns 0 if script returns 0, , 1 if script returns non-zero value illustrated below: ps c:\test> cat foo.ps1 exit 42 ps c:\test> ./foo.ps1 ps c:\test> echo $lastexitcode 42 ps c:\test> powershell -command "exit 42" ps c:\test> echo $lastexitcode 42 ps c:\test> powershell -command "& ./foo.ps1" ps c:\test> echo $lastexitcode 1 ps c:\test> using [environment]::exit(42) works: ps c:\test> cat .\baz.ps1 [environment]::exit(42) ps c:\test> powershell -command "& ./baz.ps1" ps c:\test> echo $lastexitcode 42 ps c:\test> except when script run interactively, exits whole shell. suggestions? if @ part sending -command script see never work. script running 'foo.ps1' script not have call exit, not return exit code. if return exit code wa

jquery - Javascript Tooltip hover and click -

i need tooltip in javascript. code have below works on hover, can't put function outside can called click. in function there stuff calculating tooltip position , way appears, , works. thank help. var targets = $( '[rel~=tooltip]' ), target = false, tooltip = false, title = false; targets.on( 'mouseenter', function() { target = $( ); tip = target.attr( 'title' ); tooltip = $( '<div id="tooltip"></div>' ); if( !tip ) { return false; } target.removeattr( 'title' ); tooltip.css( 'opacity', 0 ) .html( tip ) .appendto( 'body' ); var init_tooltip = function() { containerlist = $('.container').find('.listimages'); if( containerlist.width() < tooltip.outerwidth() * 1.5 ) tooltip.css( 'max-width', containerlist.width() / 2); else tooltip.css(

android - Playing Video dosnt work -

i wont play video in application ... write code below: import android.os.bundle; import android.app.activity; import android.view.menu; import android.widget.textview; public class mainactivity extends activity { public textview counter = null; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.welcomepage); videoview = (videoview)findviewbyid(r.id.videoview); log.e("ok","ok"); videoview.setvideopath("animationgif/vid.flv"); videoview.start(); } } but doesnt work !!! have solution plz ! in order set video external storage (sdcard or phone): videoview.setvideopath(environment.getexternalstoragedirectory()+"/folder/file.mp4"); to raw folder: videoview.setvideouri(uri.parse("android.resource://" + getpackagename() +"/"+r.raw.video)); android doesn't support flv. supports mp4 , 3gp (

ruby on rails - Merging multiple partials before rendering -

both partials below elements of table , have same structure. wish merge these 2 partials first , render them ajax call. possible? def refreshprojects @projects = project.get(params[:username]) render :partial => "project.elements.data", :locals => {:projects=>@projects } render :partial => "project.shared.elements.data", :locals => {:projects=>@projects_shared } end considering @projects , @shared_projects array, can pass on them combined single array 1 of partials instead of doing individually. render :partial => "project.elements.data", :locals => { :projects=> @projects + @projects_shared } in case, if there difference in partials ui, can call 2 in view name of action, i.e., refreshprojects.html.erb , remove 2 lines action. render :partial => "project.elements.data", :locals => {:projects=>@projects } render :partial => "project.shared.elements.data", :lo

How do I use a Java project that requires a 1.7 compliance level on an Android project build path? -

i'm using eclipse. if change compliance level of main (android) project 1.6 1.7, error: android requires compiler compliance level 5.0 or 6.0. found '1.7' instead. please use android tools > fix project properties. if change compliance level of "library" (java) project 1.7 1.6, lot of code in becomes invalid. is going through code of java project , fixing every error single option here? google released eclipse adt 22.6 adds support java 7 language features, http://developer.android.com/tools/sdk/eclipse-adt.html . once upgrade to latest version of plugin compiler compliance level include 1.7 option.

javascript - Filter text without HTML tags in AngularJS -

i have simple angularjs app consumes json array of objects this: $scope.faq = [ { id: 1, question: "what meaning of life?", answer: "42"}, { id: 2, question: "what <em>is<em> 1+1?", answer: "4"} ] in html have ng-repeat basic filter coming text input this ng-repeat="qa in faq | filter:searchtext" the problem want search filter while ignoring html tags in json objects, searching phrase "what is" return both objects instead of first one. how change filter this? write custom filter in html: ng-repeat="qa in faq | customfilter" in js: angular.module('youmodule', []). filter('customfilter', function() { return function(input) { var out; //parse strings(find <tag> , exclude it) , push in out variable return out; } }); upd can transmit in custom filter not input value (you can add parameter, such 'searchtext') html: ng-

c# - no update on sql server database. No errors just no results -

//the @question column name needs change according checkbox. example checkbox1 - question1 sqlconnection con = new sqlconnection(...); string sql = "update inquiry2 set @question = @str email = @email , base = @base;"; sqlcommand cmd = new sqlcommand(sql, con); con.open(); //checkbox2 - question 2 //if (checkbox3.checked == true) //{ // str = str + checkbox3 + 'x'; //} datatable thedatatable = null; // verify dt in session before trying if(session["dt"] != null) { thedatatable = session["dt"] datatable; } //verify data table not null if(thedatatable != null) { email = thedatatable.rows[0]["email"].tostring(); base1 = thedatatable.rows[0]["base"].tostring(); } //checkbox1 - question 1 if (checkbox9.checked == true) { str = str + checkbox9.text + 'x'; strquestone = thedatatable.colu

javascript - RotateY and Perspective animation not working properly in chrome? -

i want rotate image in y direction . code follows js part $(function () { $("#content").click(function () { var css = { 'transform': 'perspective(2000px) rotatey(-25deg )', 'transition-duration': '500ms' }; $("#content").css(css); }); }); css part #mainpage{ height: 100%; width:100%; position: absolute; top:0; left:0; } #menubar{ height: 100%; width:100px; position: absolute; top:0; left:0; background: #ff0000; } #content{ height: 100%; width: 100%; position: absolute; top:0; left:0; background-image:url(images/clubs/informals.jpg); background-size:100% 100%; } html part <div id="mainpage"> <div id="menubar"></div> <div id="content"></div> </div> the code working in firefox. in chrome perspect

javascript - Selecting enabled rows with ClientSelectColumn -

i have telerik gridclientselectcolumn along allowmultirowsection set true selecting rows. on server side, of rows disabled, when go ahead click button, select rows regardless button being enabled/disabled. so figured can loop through rows on client side using jquery , see if disabled , if mark them unchecked during onrowselected . but not sure how go it, have radgrid, mastertableview , several gridboundcolumn. i don't know how select items radgrid , check whether each 1 disabled previously. any tips helpful! check following telerik documentation mentions getting cell values selected rows client-side http://www.telerik.com/help/aspnet-ajax/grid-getting-cell-values-for-selected-rows-client-side.html hope helps you..

More than one html form in a php file -

i have php , html based tool has form that, when submitted, outputs data reformatted using echo commands. i'd add 2nd form same page output using echo. my issue is, when submit 2nd form first forms output disappears. i'd make echo output first form not go away when 2nd form submitted both on screen @ same time. is there way can this? only 1 <form> block in page can submitted @ single time. <input> fields defined in 1 form not submitted when other form submitted. e.g. <form> <input type="text" name="foo" /> <input type="submit" /> </form> <form> <input type="text" name="bar" /> <input type="submit" /> </form> clicking on submit submit either foo field, or bar field. not both. if want both fields submitted, have either build them single form: <form> <input type="text" name="foo" />

regex - How to replace word in notepad++ that begins with certain word plus number of bytes -

i want replace number format of yyyymmddhhmmss "". for example: 20130618100147 text here i tried find 2013(.*)$ in notepad++ (regular exp, wraparound) every word next 2013 deleted in same line. how can able replace word starting 2013 plus 10 bytes? 2013\d{10} match 2013 , 10 digits after it. upd: here's improved version of regex: 2013[0,1][0-9][0-3][0-9][0-2][0-9][0-5][0-9][0-5][0-9] that still match, example, 20130601000000 because it's valid timestamp.

java - The method toggleKey(int, boolean) is undefined for the type InputHandler -

i wandering if help, im following tuorial on input handling , tutorial reguires me create new class , write code. package net.pinkeye.javagame; import java.awt.event.keyevent; import java.awt.event.keylistener; import java.util.arraylist; import java.util.list; public class inputhandler implements keylistener{ public inputhandler(game game) { game.addkeylistener(this); } public class key { public boolean pressed = false; public boolean ispressed(){ return pressed; } public void toggle(boolean ispressed) { pressed = ispressed; } } public key = new key(); public key down = new key(); public key left = new key(); public key right = new key(); public void keypressed(keyevent e) { togglekey(e.getkeycode(),true); } public void keyreleased(keyevent e) { togglekey(e.getkeycode(),false); } public void keytyped(keyevent e) { } public void toggle (int keycode, boolean ispressed) { if(keycode == keyevent.vk_w){

python - SQLAlchemy Bidirectional Association Proxy -

i'm trying create simple many many relationship mapping table containing metadata relationship represents association proxies on both ends using sqlalchemy. however, can't seem work. here's toy example i've been working try figure out: base = declarative_base() def bar_creator(bar): _ = foobar(bar=bar) return bar class foo(base): __tablename__ = 'foo' id = column(integer, primary_key=true) name = column(string) bars = association_proxy('bar_associations', 'bar', creator=bar_creator) def foo_creator(foo): _ = foobar(foo=foo) return foo class bar(base): __tablename__ = 'bar' id = column(integer, primary_key=true) name = column(string) foos = association_proxy('foo_associations', 'foo', creator=foo_creator) class foobar(base): __tablename__ = 'foobar' foo_id = column(integer, fore

Set C# Inline Expressions in ASP.NET Controls On Server-Side -

is possible programatically insert c# inline expressions values asp.net controls in server-side code? i'm using datalist display lot of data in table. want able dynamically change columns of table, need able edit controls in itemtemplate . however, in addition editing controls in itemtemplate , need able alter value binded each control in template, because want dynamically change being displayed. so have static table doesn't change: <asp:datalist id="datalist" runat="server" onselectedindexchanged="datalist_onselectedindexchanged" datasourceid="peopledata"> <itemtemplate> <table> <tr> <td> <asp:linkbutton id="namelink" onclientclick="onpageupdate()" commandname="select" text='<%# eval(this.name) %>' forecolor='<%# eval("this.namecolor") %>' runat=server" />

Tomcat with APR connector is disconnecting Java clients with SSL -

i trying use ssl tomcat , apr connector. can make changes server, not existing java client. for reason, whenever java client connects tomcat server using ssl, not able connect - connection reset server. however, exact same java code can connect same server on different port hosted apache ssl. in addition, non-java code (like curl) can connect tomcat ssl connection. i have gotten work forcing java client use tlsv1 protocol (-dhttps.protocols=tlsv1). however, not practical solution, because cannot release update @ time our java clients. since works apache on server, seems me should able make sort of configuration change on server work tomcat, without needing change java clients. in summary: java connecting tomcat ssl = fail curl connecting tomcat ssl = good java connecting apache ssl = good curl connecting apache ssl = good here example java code illustrates problem. i'm running java 6 on mac os x. public class sslconnecttest { public static void main(string

android - Horizontal LinearLayout with Multiple Children, Move Children Below on New Line When No More Horizontal Space -

i have horizontal linearlayout wide screen , high children , trick children have dynamic width each , don't want them going off screen (cut out). want them flow/break in new line visible. although totally irrelevant android, should work similar how inline <div> 's work in html. here's have right now: <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="if enter digits in field " /> <edittext android:id="@+id/tvdistance" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="enter digits here"/> <textview android:layout_width="wrap_content"

Multi-select Jetbrains Webstorm -

how select multiple instances of text? such selecting "li" tags highlighting 1 , pressing shortcut select next instance , on. thanks well, cannot. think you're talking multiple cursors present in sublime text 2. but, if text aligned, can change using alt + click , dragging that. you can vote this feature lena mentions. update this feature supported in webstorm 8. if press alt key , click on different location, separate cursor there. before, drag , create cursors in same line, however, can place cursor wherever want to. keyboard shortcut ctrl ctrl + arrow up please take @ this video learn more.

android - In-app billing query inventory in AsyncTask? -

i followed this tutorial add loading screen launch of app while data loaded asynctask's doinbackground() function. my app features in-app billing premium upgrade , query inventory check on launch. iabhelper functions asynchronous. how can integrate iabhelper checks doinbackground() main activity loaded when has completed? my billing code follows: private void checkforpremiumpurchase() { billinghelper = new iabhelper(this, constants.base_64_key); //start setup. asynchronous , specified listener called once setup completes. billinghelper.startsetup(new iabhelper.oniabsetupfinishedlistener() { public void oniabsetupfinished(iabresult result) { if(result.issuccess()) { billinghelper.queryinventoryasync(mgotinventorylistener); } } }); } //listener that's called when finish querying items , subscriptions own iabhelper.queryinventoryfinishedlistener mgotinventorylistener = new iabhelper.queryinven

jquery - How can I do an AJAX request with an authenticated user in Django? -

i need http call using ajax authenticated user using django. is there standard simple way this? i've read other question uses different technology. i'm using http (not https) , using third-party app django-tastypie unique "simple" purpose overkill, wouldn't it? ajax requests no different other kind of request. if user authenticated, ajax request authenticated too: session cookie identifies user sent along ajax request other one. (that linked question irrelevant because talking authenticating user within request, not using already-authenticated user want.)

ios - How to insert cell into UITableViewController -

i'm creating ipad app. root uitableview has right bar button item in navigation controller. when tap button, shows pop on controller. popover uitableviewcontroller. when tap cell in popover, how pass data in cell , insert cell root uitableview? searched apple docs , couldn't find needed. can push me in right direction? roottable.h @interface roottable : uitableviewcontroller<popoverdelegate> popover.h @protocol athleteselectpopoverdelegate <nsobject> @required -(void)selectedobject:(object *)newobject; @end @property (nonatomic, weak) id<popoverdelegate> delegate; @property (readwrite, nonatomic) object *currentobject; @end popover.m - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { _currentobject = [_objectarray objectatindex:indexpath.row]; //notify delegate if exists. if (_delegate != nil) { [_delegate selectedobject:_currentobject]; } }

javascript - angular.element.addClass wired -

Image
i'm learning tutorial egghead angular.element , following create testing scripts. angular.element's behaviour different tutorial. toggleclass or addclass add "class" both "input" , "div". see below script , picture. bug? or i'm missing something? <html ng-app="app"> <head lang="en"> <meta charset="utf-8" /> <title>debug</title> <link rel="stylesheet" href="/css/foundation.css" /> </head> <body> <dumb-password></dumb-password> <script src="/js/angular-1.2.0rc1/angular.js"></script> <script> angular.module('app', []) .directive('dumbpassword', function () { return { restrict: 'e', replace: true, template: '<div><input type="text" ng-model="model.input"><div>{{model.input}}

javascript - show streetview in infowindow -

i'm trying streetview show in infowindow. had working in v2 api method (settimeout) did not work me in v3, trying use addlistener method show panorama. error getting null reference when try pass div wish show streetview in. found couple of questions on here seemed on point don't see doing differntly - both examples used infowindow domready event using also. here code. var map; function initialize() { var lat = document.getelementbyid("lat").value; var lon = document.getelementbyid("lon").value; var latlon = new google.maps.latlng(parsefloat(lat), parsefloat(lon)); var mapoptions = { center: latlon, zoom: 15, streetviewcontrol: false, maptypeid: google.maps.maptypeid.roadmap }; map = new google.maps.map(document.getelementbyid("map-canvas"), mapoptions); var sv = new google.maps.streetviewservice(); sv.getpanoramabylocation(latlon, 50, showshopinfo); } function showshopi

appscript - How to hide the automator application icon when running -

Image
i create automator application , set run @ logon, , check "hide" box, still shows (the gear icon) in status bar. how can hide it? i check "hide" box here: but gear icon still shown (the worse part never stops rotating!) is possible hide icon, or let stop rotating? control-click on it, , choose show package contents pop-up menu. inside contents folder, open info.plist, , change lsuielement no yes (if using property list editor) — or change line after lsuielement key line (if using text editor). save info.plist. when alarm triggers, automator plugin run in background, without dock icon or menu bar, , focus remain on application you’re using. three things note: you might have move plug-in out of ical folder , in work. tiger caches lsuielement info; moving app forces tiger renew cache. you not want ical plugin has dialogs or requires user interaction! works best maintenance actions, automated downloads, , sort of thing. third, work automat

python - Iterating Over a Dictionary -

i trying return values in dictionary have value greater int argurment. def big_keys(dict, int): count = [] u in dict: if u > int: count.append(u) return count i don't understand why isn't working. returns every value in list rather greater in. by default, dict iterate on keys, not values: >>> d = {'a': 1, 'b': 2} >>> in d: ... print ... b to iterate on values, use .values() : >>> in d.values(): ... print ... 1 2 with in mind, method can simplified: def big_keys(d, i): return [x x in d.values() if x > i] i have changed variable names, since dict , int both built-ins. your method recreating default functionality available in python. filter method trying do: >>> d = {'a': 1, 'b': 6, 'd': 7, 'e': 0} >>> filter(lambda x: x > 5, d.values()) [6, 7] from comment seems looking keys , not values. here how

php - will my data collide? -

i post data remote php file , there using post method saving data remote mysql database simple is. but worry getting data every 30sec 1minute , sending server via http post android mobile i.e 'n' no of mobiles so, data collide? there chance of loosing data? ex: 100mobiles currently using 000webhost.com free hosting, planning move paid one. but need buffer incoming data , save avoid data loss? or continue same approach , have high speed server? i dont have knowledge maximum @ speed server can process incoming data. if many data comes many mobiles @ same time? need manually buffer or server me. if manual buffer please share code can understand better. (battery of android mobile have taken care , using gps , network provider) <?php $longitude = $_post['lon']; $latitude= $_post['lat']; $imei= $_post['imei']; $speed = $_post['sp']; $date = $_post['date']; if($longitude != "" && $latitude != "")

javascript - Sprockets' asset_path is not returning the digested path of an HTML asset in production. -

i've got template html , js files in assets directory, structured this: app - assets - templates - my_template.html - javascripts - application.js - main.js.erb where application.js contains standard sprockets directive: //= require main and main.js.erb contains reference path my_template.html : main.js.erb : // code here ... return { pathtotemplate: "<%= asset_path 'my_template.html' %>" } // more code here ... in development, works great. main.js.erb evaluated following: // code here ... return { pathtotemplate: "assets/my_template.html" } // more code here in production, assets precompiled (gzipped , whitespace removed), , fingerprint appended filename. production main.js.erb should like: pathtotemplate: "assets/my_template-610dd79b5bb3c20d14b81baa891fc9dd.html" but instead same in development. does sprockets need configured fingerprint html files? perha

zurb-foundation gem not added to asset path in existing Rails 3.2 application -

i have existing rails 3.2.14 application trying add zurb-foundation to. have added zurb-foundation gem , run installation generator. my problem that, whenever try load page, error: couldn't find file 'foundation' when sprockets hits //= require foundation line in application.js the problem appears directory assets zurb-foundation gem not being added load path. in contrast, have application generated more recently, including zurb-foundation beginning, , @asset_paths.asset_environment.paths includes following "/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/jquery-rails-3.0.4/vendor/assets/javascripts", "/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/coffee-rails-3.2.2/lib/assets/javascripts", "/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/zurb-foundation-4.3.0/scss", "/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/zurb-foundation-4.3.0/js"

python - Django Forms: No 'field errors' or 'non field errors'. But is_valid returns false -

views.py form1 = form1(temp_arg=obj) form2 = form2() if request.method == 'post': print "submitting form" form1 = form1(request.post) form2 = form2(request.post) print form1.is_valid # prints false print form2.is_valid # prints true print form1.errors # prints none print form2.errors # prints none print form1.non_field_errors() # prints none print form2.non_field_errors() # prints none if form1.is_valid() , form2.is_valid(): print "form valid" # not executed #some code form.save , else: print "error!" # prints forms.py @parsleyfy class form1(modelform): def __init__(self, temp_arg, *args, **kwargs): temp_val = temp_arg super(form1, self).__init__(*args, **kwargs) self.fields['field1'] = forms.choicefield( choices=get_field_choices(temp_val)) class meta: mod

How can I upload a file to php using JQuery and ajax -

does know tutorial on how upload file php using jquery , ajax? this http://www.plupload.com/ and there examples http://www.plupload.com/example_queuewidget.php if download inside .zip there folder called examples , in folder can find upload.php. how processing sent file.

SugarCRM: How to retrieve complex SQL statements with sugar internal functions? -

in order retrieve contact, having cell phone number of 09362724853 , use following code: $newsms_contact = new contact; $newsms_contact->retrieve_by_string_fields(array('phone_mobile'=>'09362724853')); how retrieving contact having cell phone number of 09362724853 or 9362724853 or +989362724853 sugar internal functions? this doesn't work: $newsms_contact = new contact; $newsms_contact->retrieve_by_string_fields(array('phone_mobile'=>'09362724853', 'phone_mobile'=>'9362724853', 'phone_mobile'=>'+989362724853')); the thing function trying utilize created other goals. since fetches 1 row db , fills bean it, array of parameters turned string separated and operators. have different case. i suggest use approach, less convenient more reliable: $contact_bean = new contact(); $contacts_list = $contact_bean->get_full_list(null, '(phone_mobile = "09362724853" or p

javascript - AJAX + JSON for simple login -

i new ajax , json i'm looked tutorials seems that dept me. i decided make simple login see how ajax , json works don't know how start. said need library jars , said javasrcipt here simple login jsp page <body> <form action="logincontroller" method="post"> <!-- login body --> <table> <tr> <td><label for="username" >username:</label></td> <td><input type="text" name="username" /></td> </tr> <tr> <td><label for="password" >password:</label></td> <td><input type="password" name="password" /></td> </tr> <tr> <td><input type="submit" /></td> </tr> &