Posts

Showing posts from March, 2013

Android dialog activity with holo light theme -

i need dialog activity. defined activity in manifest file with: android:theme="@android:style/theme.dialog" but theme has old gingerbread dark background , on. want complete holo theme on dialog activity... there theme theme.dialog.holo.light ? use under activity tag: <activity android:theme="@android:style/theme.holo.light.dialog" > </activity>

php - Htaccess proxy redirect wordpress error -

i want redirect domaina.com/folder/ originates within older wordpress installtion domainb.com/folder1/folder2/ link page within new wordpress installation wihtout url changing. i have managed achieve this .htaccess file inside domaina.com/folder/ reads: rewriteengine on rewritecond %{request_uri} ^/folder rewriterule ^(.*)$ http://www.domainb.com/folder1/folder2/ [p] the rewriterule [p] (proxy) flag want , redirects page without changing url but of content within enfold wp template such advanced layer slider , icons fail load. i assume error due sort of conflict wp's native htaccess code , suspect has lines: rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] i have experimented adding first, third , fourth lines code doesnt work. know how resolve issue? if makes difference wordpress site want direct (domainb.com/folder1/folder2/) 1 whithin wordpress network. for mom

html - font size and image size not respected when converting to pdf using itextsharp -

i've got code convert html pdf using itextsharp, however, when view pdf, font sizes , size of images different has been specified in html. my code below - appreciated: public function renderpdf() memorystream dim file new memorystream() dim document new itextsharp.text.document(me.pagesize) dim writer pdfwriter = pdfwriter.getinstance(document, file) document.open() dim tagprocessors defaulttagprocessorfactory = tags.gethtmltagprocessorfactory() tagprocessors.removeprocessor(html.tag.img) 'remove default processor tagprocessors.addprocessor(html.tag.img, new customimagetagprocessor()) 'use our new processor using document 'render each page has been added each page htmlpdfpage in me._pages document.newpage() 'generate page of text dim output new memorystream() dim html new streamwriter(output, encoding.utf8) dim sr new stringreader(page._html.tost

php - Insert a value by row and column based using jQuery -

i have array rows , columns values corresponding rows , columns. need insert values table. the array have below: array ( [cols] => array ( [0] => c1 [1] => c2 [2] => c3 ) [rows] => array ( [0] => r1 [1] => r2 [2] => r3 [3] => r4 ) [name] => array ( [0] => 1 [1] => 2 [2] => 3 [3] => 1 [4] => 2 [5] => 3 [6] => 1 [7] => 2 [8] => 3 [9] => 1 [10] => 2 [11] => 3 ) ) the table structure need is: id | row | column | value -------------------------- 1 | r1 | c1 | 1 2 | r1 | c2 | 2 3 | r1 | c3 | 3 4 | r2 | c1 | 1 5 | r2 | c2 | 2 6 | r2 | c3 | 3 7 | r3 | c1 | 1 8 | r3 | c2 | 2 9

javascript - if I am using only integers as keys how can get last inserted key in localstorage? -

i trying build registration form , using localstorage save details. while adding form details locastorage, want know value of last inserted key can increment , can insert new record incremented value of key. how can done. current code overwriting values if delete record, since taking count of keys available in storage. function setlocal(){ var o = {}; var ff = $('#myform').serializearray(); $.each(ff, function() { if (o[this.name] !== undefined) { if (!o[this.name].push) { o[this.name] = [o[this.name]]; } o[this.name].push(this.value || ''); } else { o[this.name] = this.value || ''; } }); var tt = json.stringify(o); localstorage.setitem(localstorage.length+1, tt); $('#afterinsert').text('data added sucessfully'); return true; } any suggestions? why can't store last

vb.net - Using panels in ASP.net -

i created textbox, button , panel in page. aim create links put inside panel. however, turns out every time add one, seems replace created link. there way add links, not replacing created links? don't have background in asp. this code researched. protected sub button1_click(byval sender object, byval e eventargs) handles button1.click dim link new hyperlink() dim ltr new literal() link.text = textbox1.text link.navigateurl = "default.aspx?field1=" + textbox2.text + " " ltr.text = "<br/>" panel1.controls.add(ltr) panel1.controls.add(link) please me. thanks! as said @rex, when post occurs dynamically controls removed page until retain them in init event. while adding controls placeholder, save same data id, text..etc. in object session variable , retrieve same data in page init event , add place holder. protected void page_init(object sender, eventargs e) { // retrieve session variable , add

Android: Get color Theme dark -

i have created menu in application , looks white background. want color theme of black background. have change in code it? have declared in styles: <style name="appbasetheme" parent="android:theme.holo"> edit not want color black background. want dark theme many apps have. my current color menu link 1 my whised color menu link 2 <style name="appbasetheme" parent="android:theme.holo"> </style> <style name="apptheme" parent="appbasetheme"> <item name="android:textcolorprimary">#ff000000</item> </style> u can android theme parent="android:theme.holo.dark" parent="android:theme.holo" and custom u can set <resources> ... <style name="mycustomtheme" parent="android:style/theme"> <item name="android:textcolorprimary">#ffff0000</item>

Can't pickle <type 'thread.lock'> when using python multiprocess.pool.map_async() -

i'm trying use map_async on class method , error: picklingerror: can't pickle <type 'thread.lock'>: attribute lookup thread.lock failed code : def _pickle_method(method): func_name = method.im_func.__name__ obj = method.im_self cls = method.im_class cls_name = '' if func_name.startswith('__') , not func_name.endswith('__'): cls_name = cls.__name__.lstrip('_') if cls_name: func_name = '_' + cls_name + func_name return _unpickle_method, (func_name, obj, cls) def _unpickle_method(func_name, obj, cls): cls in cls.mro(): try: func = cls.__dict__[func_name] except keyerror: pass else: break return func.__get__(obj, cls) copy_reg.pickle(types.methodtype, _pickle_method, _unpickle_method) class myclass(object): def submit(self,cmd): subprocess.call(cmd, shell=true) def runtest(self): cmd

email - Google apps mail are spammed -

we have been using google apps gmail service on 2 years. 2 months our mails getting spammed or not reachng our clients. spam prevention have used: dkim key authentication txt record checked our mail spam score on http://www.mail-tester.com above 9. can suggest measures stop mail spamming? since you've got 9 out of 10, you're on 1 blacklist. find out spam filter software clients use, , 3rd party blacklists use. 1 blacklist might cause. try reports clients spamfilter.

sql server - update nvarchar not null field length -

i can update column's length if in null when created mycolumn1 nvarchar(12) null my query: alter table mytable alter column mycolumn1 nvarchar(13) null but how can change length if column not null? mycolumn2 nvarchar(12) not null alter table mytable alter column mycolumn2 nvarchar(13) not null when try sql server says msg 4902, level 16, state 1, line 1 cannot find object "mycolumn2" because not exist or not have permissions. i have permission because admin , table's column exist. guys response... here table structure create table [dbo].[mytable]( [mykey] [int] identity(1,1) not null, [mycolumn1] [nvarchar](12) null, [mycolumn2] [nvarchar](12) not null, constraint [pk_mytable] primary key clustered ( [mykey] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] column names case sensitive. please try alter tab

session - Get post from Google+ without browser's authentication in google's account via PHP -

i'm want google+ posts via php, google requires login via browser. it's possible provide account's authentication via php, allowing me posts without login every time want posts? the code is: <?php require_once 'src/google_client.php'; require_once 'src/contrib/google_plusservice.php'; session_start(); $client = new google_client(); $client->setapplicationname("google+ php starter application"); // visit https://code.google.com/apis/console?api=plus generate // client id, client secret, , register redirect uri. $client->setclientid('clientid'); $client->setclientsecret('clientsecret'); $client->setredirecturi('http://localhost/ola/google+/simple.php/b.html'); $client->setdeveloperkey('apikey'); $plus = new google_plusservice($client); if (isset($_get['logout'])) { unset($_session['token']); } if (isset($_get['code'])) { // login stuff <------- if (str

javascript - Jquery UI slider attach label -

i have modal, shows @ times , have 2 sliders on it, should show values. here's code: div#averageanswermodal.modal.fade.custom-modal(tabindex="-1", role="dialog", aria-labelledby="mymodallabel" aria-hidden="true") div.modal-content div.modal-body(style='text-align: center;') h2 neighbor's answers average was: div div#noavg neighbors didn't give anwer div#avgslider span#avglabel h2 answer was: div dvi#notanswered didn't give anwer div#yourslider span#yourlabel i have code set sldiers initializemodal = function() { var positionlabel = function(label, slider, val) { $(label).html(val).position({ my: 'center top', at: 'center bottom', of: $(slider + ' > .ui-slider-handle') }) } mymodal = $(

graph - Affix the cytoscape.js edge label to the edge -

this of follow on question (i'm piggybacking here): add edge label cytoscape.js this allows add label edge, labels horizontal regardless of edge's actual position. there anyway bind label edge when edge repositions, label rotates it? i made patch cytoscape, maybe helpfull you. link patched buld version: cytoscape-2.3.4-patched.js link patch builded js file version 2.3.4: cytoscape-2.3.4.patch please, ask questions if have.

django site urls whose are not under site-packages -

lets assume have django website svn directory not under site-packages. whenever run: mysyper_dir/whatever_module/manage.py runserver 0.0.0.0:8888 and connect, realize request still handled python files in: ....../site-packages/whatever_module/ while can see prints of mysyper_dir/whatever_module/setting.py from server console. there way tell django that, every "non-framework" files ever need in "mysyper_dir/whatever_module" directory ? neither of these django specific (python handles this) there's couple of things do. set environment variable pythonpath , or add directories sys.path . can find more modules located here . if looking have things just apply django, adding sys.path might best bet. try weird modifying manage.py , adding command line arguments after #!/usr/bin/env python that's uncharted territory me.

multithreading - Java Multithread, Multi-Client Server- Client not executing run method -

trying better @ java, i'm attempting create mutlithreaded client & server messenger, in client sends message server, , server redirects & sends message user first client wanted send to. i've been researching lot concurrency , multithreading , such. current problem, i've concluded, bufferedreader/inputstream client isn't "ready" when start run thread, , returns nullpointerexception. few other questions: should drawgui() method in swingutilities.invokelater() statement or not matter since i'm not interacting gui in method wondering if hashmap usersip work key-value pair, pair clients ip. there's 1 of these in server class was gonna ask question, forgot was. edit in later if remember client code(cut down useful stuff) public class client extends thread { public static socket socket; public static printstream os; public static bufferedreader is; public static stringbuffer toappend = new stringbuffer(""); public static stri

jsf 1.2 - JSF Identify errors generated in process validations phase -

i'm new jsf , want make modifications in existing code. while code working fine, have problem a4j (rich faces) onchange event. my tech stack related here jsf1.2, richfaces 3.3 the code snippet below: <h:selectonemenu required="#{order.required}" id="modelcbfs" label="model" value="#{order.modeldto}" converter="modelconverter"> <f:selectitem itemlabel="-select-" itemvalue =""/> <f:selectitems value="#{order.modeldropdown}" /> <a:support ajaxsingle="false" limittolist="true" rerender="elevationcbfs" event="onchange" action="#{order.modelchanged}" onsubmit="onhourglass()" oncomplete="offhourglass()"/> </h:selectonemenu> now, when above code rendered on page, ajax event being fired, jsf page not go thru 4th ,

javascript - Stall submitting of a form with js/jquery? -

i have few ajax requests need complete before can submit form. how can stall within form.submit() call until ajax requests done? var incompleteajaxcalls = 0 // each ajax call runs incompleteajaxcalls++ // followed incompleteajaxcalls-- upon completion myform.submit(function () { //sleep while incompleteajaxcalls > 0; }); prevent form submitting, submit when ajax calls have completed myform.submit(function (e) { e.preventdefault(); var self = this; $.when( $.ajax({url: 'ajax1'}), $.ajax({url: 'ajax2'}) ).always(function() { self.submit(); }); }); edit: for array do myform.submit(function (e) { e.preventdefault(); var self = this, xhr = []; xhr.push( $.ajax({url: 'ajax1'}) ); xhr.push( $.ajax({url: 'ajax2'}) ); $.when.apply($, xhr).always(function() { self.submit(); });

java - GWT- CellTable--Trouble with setting row highlighting -

so little confused how set css of individual row in datagrid (which understand can use celltable can use). first have double click , single click handler correctly called in 'oncellpreview'(had remove selectionmodel work). can row number through event.getindex(). next fail in attempt set css selected row, code: int row= event.getindex(); mydatatable.setrowstyles(new rowstyles<string[]>(){ @override public string getstylenames(string [] rowobject, int therow){ if (row== therow){ return "mydatagridselectedrow"; } else return "mydatagrid"; } }); however don't understand how supposed work (which perhaps why can't work) how getstylenames() called? steps on in debugger. where should setrowstyles method call located in code? i suppose work must remove call mydatatable.setstylename("mydatagrid"); there pre-existing css class in datagridoverride.css(which different main css

charts - vba excel 2007 referencing data? -

i inheriting vba code other people. the.......some other code make chart of existing data in excel. dont source datasets referenced. data x-axis? data y-axis??.......... ........some other code............ ' * ** * ** * ** * ** * ** * ** ' **** charts * ** * ** * * ' * ** * ** * ** * ** * ** * *** windows(nm_driver).activate activesheet.range("a19") = "" 'intialize cell empty '*******copies previous sheet , makes new sheet******** windows(nm_out).activate sheets(2).select sheets(2).copy after:=sheets(worksheets.count) j = j + 1 sheets(j).select debug.print "j=" & j windows(nm_driver).activate out_sht_nm = activesheet.range("a8") & " plots" debug.print "out_sht_nm" & out_sht_nm activesheet.range("a10").select selection.copy windows(nm_out).activate sheets(j).select activesheet.range("h1").sel

vb.net - Access collection of user setting current values -

is there built in collection of current values of user settings accessible? using loop below, can iterate through default user settings however, cannot access current values. there way achieve this? for each setting system.configuration.settingsproperty in my.settings.properties console.writeline(setting.name & " >> " & setting.defaultvalue) next the my.settings property give access given applications users settings looking @ right thing. these can arbitrarily written , stored save method. once call save values should persist across instances of application. note though applies application, not others. have settings across applications need choose different storage medium registry

javascript - Store a function in IndexedDb datastore -

is possible in way store function in indexeddb datastore? have done searching , found nothing on data types indexeddb supports. tried adding function , instance of function object store follows, didn't work. var myclass = function () { self = this; self.name = 'sam'; self.hello = function () { console.log('hello ' + self.name); }; } var transaction = db.transaction(['codeobject'], 'readwrite'); var store = transaction.objectstore('codeobject'); var request = store.put({ 'classname': 'someclass', 'object': myclass }); and have tried. var request = store.put({ 'classname': someclass', 'object': new myclass() }); i store class in object db. if had store type of blob , serialize function on way out. thank you if question right, want serialize entire object including functions? this possible do, need make possible serialize functions. more information it,

apache - htacces if statement https redirect for one page -

i've made big mistake of client's secure pages , relative navigation , google has started indexing site showing https in results , not http version "breaks" site. i want 301 redirect pages except one, non https version in htaccess. i'm trying redirect every page except /(language variable)/form.html http:// version i'm running apache 2.2.26. saw similar want below i'm not running apache 2.4 500 error. rewriteengine on <if "%{http_host} == 'www.canpujolet.com/^([a-z]{2})/form.html$'"> rewritecond %{https} off rewriterule ^([a-z]{2})/form.html$ https://www.canpujolet.com/$1/form.html [r=301,l,qsa] </if> <else "%{http_host} !== 'www.canpujolet.com/^([a-z]{2})/form.html$'"> rewritecond %{https} on rewriterule (.*) http://%{http_host}%{request_uri} [r=301,l,qsa] </else> any , advice appreciated. you can use: rewriteengine on rewritecond %{https} off rewritecond %{the_reque

execute cygwin sort command from batch file -

i trying run sort command batch file take lines new.txt , output them unique.txt c:\cygwin64\bin\bash -c "sort -u new.txt > unique.txt" this not working however, if place new.txt home/administrator directory , run command in terminal works fine. wrote script: #!/bin/bash sort -u /home/administrator/new.txt > unique.txt batch file: set path=c:\cygwin64\bin;%path% c:\cygwin64\bin\bash.exe /usr/bin/u.sh all :)

php - Show data saved previously in Mysql database with implode -

Image
i need know how can show data saved in database , make actions treatment info. need show info first capture always...can me these? here captures: this 1 when treatment info prepare save database: and other when data in database: here code: include_once("configs.php"); if (!empty($_post)) { try{ $diente_id = is_array($_post['diente_id']) ? implode(', ', $_post['diente_id']) : $_post['diente_id']; $cara = is_array($_post['cara']) ? implode(', ', $_post['cara']) : $_post['cara']; $tratamiento = is_array($_post['tratamiento']) ? implode(', ', $_post['tratamiento']) : $_post['tratamiento']; $stmt = $conn->prepare('insert odontograma (diente_id, cara, tratamiento, id_paciente) values (:diente_id, :cara, :tratamiento, :id_paciente)'); $stmt->bindparam(':diente_id', $diente_id); $stmt->b

css - Wordpress Header Nav Positioned Over Fullscreen Background Image -

i using pro-theme "frame" wordpress , have not been able find support elsewhere issue (developer of theme won't support plugin compatibility issues--understandably). trying re-position header/nav not overflow onto background images, rather, background images positioned below header/nav wrapper/container. i've been trying fix issue few days , cannot find solution. for example: below link show bg image of woman , head not cropped/covered. need whatever changes responsive , work additional features on site (i.e. - homepage has slideshow, etc.). link thank help--it appreciated! best regards, the html of page mess. suggest modify background image of woman (with whatever editor want), add top margin image, let's 80px white colour. this easiest solution. if provide me more details background generated/paced may able give css solution.

ios - UIImagePickerController crashes when using PhotoLibrary as source -

i'm using xcode 5.1 , tested code both on ios7.1 , 7.0.2. app crashes uiimagepickercontroller in 2 scenarios on device: 1) when allowsediting set yes, after crop picture , press "choose", goes own view, app crashes 2) inside uiimagepickercontroller , when go photo list album list , @ bottom of photo list, crashes (no matter allowsediting yes or not). note not crash if scrolled photo list up. here code: - (ibaction)photopickpressed:(id)sender { if ([self isphotolibraryavailable]) { self.imagepicker = [[uiimagepickercontroller alloc] init]; self.imagepicker.delegate = self; self.imagepicker.sourcetype = uiimagepickercontrollersourcetypephotolibrary; self.imagepicker.allowsediting = yes; nsstring *requiredmediatype = (__bridge nsstring*)kuttypeimage; self.imagepicker.mediatypes = [[nsarray alloc] initwithobjects:requiredmediatype, nil]; [self presentviewcontroller:self.imagepicker animated:yes comple

asp.net - How do i create name of List dynamically? -

i trying create => { "data1":{ "datalistone": [0, 1], "datalisttwo": [1, 0, 0, 0] }, "data2":{ "datalistone": [1, 0], "datalisttwo": [0, 0, 0, 1] }, "data-n" : { "datalistone": [1, 0], "datalisttwo": [0, 1, 0, 0] } } list dynamically starting data1 data-n not specified @ point need stop list , want 2 list (datalistone, datalisttwo) inside data1 data-n. i not getting how create list dynamically data1 data-n , 2 list (datalistone, datalisttwo) inside dynamic list data1 data-n please me this. i'd use json.net - lets build json dynamically: using system; using system.collections.generic; using system.linq; using newtonsoft.json.linq; class program { static void main(string[] args) { var pairs = new list<listpair> { new listpair { data

Email Campaign Problems and Testing Outlook 2007 -2010 -

i trying make email campaign display correctly in email clients. have tried many fixes , ways email display write. got work reasonably on email clients , have tested on emails on acid , campaign monitor don't tell wrong code show me picture not helpful. i believe 1 of main issues email expands full width in outlook 2007 , reason , cant use max-width attribute need help. i wondered if out , see in code noticeably wrong , needs fixed. <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <title>go city - email</title> <style type="text/css"> .readmsgbody {width: 100%;} .externalclass {width: 100%;} table {border-collapse: collapse;} a:hover {text-decoration: none !important;} {color: #fff !important;text-decoration: none !important;} p {font-size: 14px;line-height: