Posts

Showing posts from May, 2011

php - $_POST is empty even though CONTENT_LENGTH is correct -

i've got http post pointed @ 2 different places. the first location handled thirdparty solution , can't see how they're handling data (which must because values getting through , i'm seeing results). in my location , have nginx server (which has never had problems before lots of use). using php read post data , , expect content in $_post variable post $_server["content_type"] => "multipart/form-data" but, though type , $_server["content_length"] correct, i'm getting nothing in $_post , $_request , , when checking file_get_contents('php://input') there nothing inside either. the body small json lump (<1k) . array of objects. to see what's in arrays used echo json_encode( array( "get" => $_get, "post" => $_post, "request" => $_request, "server" => $_server ) ) i've run out of ideas of check now. the entry $_server["php_self"] has str...

java - How to use `transient` members? -

i have serialized class transient members. not sure how use members. public class clientbeanbase extends beanbase { protected rewsstubclient getservicestub( boolean initsession ) { rewsstubclient stub = null; stub = (rewsstubclient) sessionvars.get(constants.session_key_stub) ... } my base class is: public class beanbase implements serializable { protected transient map<string,object> sessionvars = ...; ... } i see sessionvars being null in getservicestub . confused when can use sessionvars in clientbeanbase ? you can use sessionvars whenever like. the thing transient keyword does, tell jvm not serialize particular field in case of object serialization. in other words, reset it's default value when object recreated.

iphone - Override method using runtime library -

i need override - (void)viewwillappear:(bool)animated for viewcontrollers adding nslog(@"blabla") in method. i.e. after every call of viewwillappear invokes implemented realization of viewwillappear + nslog message. possible? if yes, please give me advice. currently have tried code @implementation runtimetest imp previusimp; imp newimp; - (void)ovverrideviewwillappearinviewcontroller:(class)vcclass { newimp = class_getmethodimplementation([self class], @selector(viewwillappear:)); method viewwillappearmethod = class_getinstancemethod(vcclass, @selector(viewwillappear:)); previusimp = method_setimplementation(viewwillappearmethod, newimp); } - (void)viewwillappear:(bool)animated { previusimp(self, @selector(viewwillappear:), animated); nslog(@"log2"); } @end then have @implementation irviewcontroller2 - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; nslog(@"log"); } @end my custom view...

hibernate - HQL Criterion with join -

i have use case display list of entities using subset of values in full entity. approach have taken create entitylist class fields appear in list. class mapped same table full entity subset of fields. using hql, want filter entitylist returned based on fields in full entity. in example below, want entitylist filtered on description field of entity (which in table not in entitylist class). public interface ithreephasemotorlist { abstract public long getid(); abstract public string getmfg(); abstract public double getpowerunits(); abstract public integer getpoles(); } public interface ithreephasemotor extends imotor { public abstract long getid(); public abstract void setid(long id); public abstract integer getversion(); public abstract void setversion(integer version); public abstract string getidsrc(); public abstract void setidsrc(string idsrc); public abstract string getdescription(); public abstract void setdescription(string description); public abstract string getmanu...

java - Centralized Application properties for multiple system -

i looking open-source solutions allow hosting different properties different applications , allow changes. on change of properties should notify or push change application appropriately. so, instead every application managing properties in physical file , deploying physically; these properties can pushed single system. user have gui load , change properties per right. should allow push mentioned. if have similar open source solutions in mind please advice. is puppet can manage you?

c# - Custom inspection pattern for catch block logging -

i have downloaded trial of resharper 7.1. goal enforce rule our custom logger must used on catch blocks within our c# code-base. example; try{ // amount of code } catch(exception e){ } should illegal, however: try{ // amount of code } catch(exception e){ logger.logexception(e.message, e); } is acceptable. end, have following pattern set detect , re-factor. search pattern: try{ $anystatements$ } catch($exceptiontype$ $exceptionarg$){ $anycatchstatements$ } replace pattern: try{ $anystatements$ } catch($exceptiontype$ $exceptionarg$){ logger.logexception($exceptionarg$.message, $exceptionarg$) $anycatchstatements$ } resharper detecting smells fine, treating replace pattern smell in added line logging being matched $anycatchstatement$ placeholder. how can define placeholder describe "match number of statements in catch block not calls custom logger, , append call logger"? unfortunatley no, i'm using reshar...

wireshark - How can I convert the RTP payload containing SILK-encoded audio into a file? -

i have pcap of voip call involving silk . i'm able see in wireshark rtp payload. rtp headers can understand sample rate (e.g. 24 khz) , frame size (e.g. 20 ms). i'd extract rtp payload , generate file containing silk-encoded audio. the rtp payload format description can see in case of storage in file, each block of audio needs block header, specify sample rate , block size (because block size variable , can different on each frame). how can generate file correct file header ("magic number") , add block header each block of audio? i can use few different programming languages i'm interested in required algorithm, appreciate references code implementations (or perhaps existing tool?). use pcaputil of pjproject : converts captured rtp packets in pcap file wav file or play audio device. can filter pcap file on source or destination ip or port, able deal srtp , supports codecs in pjmedia, including silk (have not tried myself). examples: pcaputil...

BIRT report_ repeating the stucture on the basis of group -

with model like: "student (1)->( ) school, student (1)->( ) result (student,school)" i need generate birt report folows, ::::::::::::::::::::::school detail::::::::::::::::::: school name: _ __ _ __ _ __ _ __ _ ___ location: _ __ _ __ _ __ _ __ _ __ _ _ school grade: _ __ _ __ _ __ _ __ _ __ _ __ _ _ result year|result|marks ... ... avg marks xxx summary : conduct has avg % marks i need repeat above structure in birt report every school, student has been through. feature of birt report can/should use create report. not simple listing of records , grouping, th structure nedd in report not tabular , destributed description of result of 1 or multiple queries. structure has repeated every school. see tutorial 1: building simple listing report help > contents you use list, sub report (probably table) imbeded in list, sub table limited student being reported each list event.

java - Convert ZipOutputStream to FileInputStream -

i have code takes file, zip it, , stores in database looks // step 1 - create zip file byte[] buffer = new byte[1024];// 18024 zipoutputstream outzip = new zipoutputstream(new fileoutputstream("file.zip")); outzip.setlevel(deflater.default_compression); fileinputstream in = new fileinputstream(c:\file.hex); outzip.putnextentry(new zipentry("file.hex")); int len; while (( len = in.read(buffer)) > 0) outzip.write(buffer, 0, len); outzip.closeentry(); in.close(); outzip.close(); // step 2 - insert zip file db file = new file("file.zip"); fileinputstream fis = new fileinputstream( file ); the fis object store in db but avoid filesystem , , not create file.zip. think need convert zipoutputstream fileinputstream directly not find way it. is there easy way accomplish ? i have same problem...

webmatrix - Problems Deploying web application to iis -

built web application webmatrix, try deploy locally iis 5.1 testing purposes added wwwroot folder didnt work created virtual directory. home page works login created web helper doesnt work...when click login see browser sending login? , nothing happens....and web deploy installed doesnt work either can deploy site dependencies iis... can deployed windows server2003....any hints appreciated... . i using webmatrix3 , web server windows server 2008 r2 iis7. copy , paste entire project directory local machine iis inetpub/wwroot directory. within iis7 right click directory (which in tree under sites) , select "convert application". works every time. i had add web.config make work in i.e. because of forced compatibility mode issue: <system.webserver> <httpprotocol> <customheaders> <clear /> <add name="x-ua-compatible" value="ie=edge" /> </customheaders> </httpprotocol> </system.webse...

php - Is this Data Encryption/Storage Method Secure? -

let me first i know bad idea store sensitive information in mysql database, please don't respond saying "don't it" or effect. building website absolutely essential store social security numbers, , have able retrieve data out of db (no hashing). that said, have researched best way encrypt/decrypt data, , built custom function handle encryption. here encrypting function: function my_data_encrypt($value){ $salt=substr(uniqid('', true), 0, 20); $key=$salt.my_private_key; $enc_value=base64_encode(mcrypt_encrypt(mcrypt_rijndael_256, md5($key), $value, mcrypt_mode_cbc, md5(md5($key)))); return array("enc_value"=>$enc_value, "salt"=>$salt); } so generating random string salt, appending salt private key my_private_key defined in separate config file. use mcrypt_encrypt encrypt data, base64_encode make encryption safe store in db. encrypted string , unique salt returned , stored in db together. my thinking throw...

WCF not exposing method -

i have service contract defined as: [system.servicemodel.servicecontractattribute(namespace = "http://www.ans.gov.br/tiss/ws/tipos/tisscancelaguia/v30001", configurationname = "itisscancelaguia")] public interface itisscancelaguia { [system.servicemodel.operationcontractattribute(action = "tisscancelaguia", replyaction = "*")] [system.servicemodel.faultcontractattribute(typeof(tissfaultws), action = "", name = "tissfaultws", namespace = "http://www.ans.gov.br/padroes/tiss/schemas")] [system.servicemodel.xmlserializerformatattribute(supportfaults = true)] [system.servicemodel.serviceknowntypeattribute(typeof(signaturetype))] mensagemtiss tisscancelaguia_operation(string mensagem); } and implementation: [servicebehavior(instancecontextmode = instancecontextmode.single, concurrencymode = concurrencymode.single, configurationname = "cancelaguiats")] public sealed class tisscancelaguia : itis...

android - Closing Sliding menu onItemClick -

so, i'm using jfeinstein10 library slidingmenu. works fine i'm having problem toggle menu when user taps in 1 of menu options. i have mainactivty slidingmenu , fragment called samplelistfragment set menu options. what i'm trying call function mainactivity when click option. function should toggle menu, instead nullpointexception error. my mainactivity public class mainactivity extends baseactivity implements slidingactivitybase { private slidingmenu menu; private imagebutton btn_pesquisa; private imagebutton btn_toggle; private makemateria makemat = new makemateria(); private static final int screen_orientation_portrait = 1; string id_test; samplelistfragment listfragment = new samplelistfragment(); public mainactivity() { super(r.string.title_bar_content); } public void maintoggle() { log.d("1", "" + this); toggle(); log.d("2", "" + this); } public static intent newinstance(activity activity, int ...

mysql - SQL Server : if record found update else insert, merge query error correction -

i have come following query sql server updating row if found else insert merge tblpermissions t using (select cid, uid tblpermissions) s on (t.cid = s.cid , t.uid=s.uid) when not matched insert (cid, uid, [read], [write], [readonly], [modify], [admin]) values ('1', '1', 1, 1, 0, 1, 1) when matched update set [read]=1, write=1, readonly=0, modify=1, admin=1 ; although not through error, not achieving expect. there's no record in table , not inserting new record. any correction? edit: considering suggestions have modified further below,without expected result though - merge tblpermissions t using (select '1' cid, '1' uid tblpermissions) s on (t.cid = s.cid , t.uid=s.uid) when not matched insert (cid, uid, [read], [write], [readonly], [modify], [admin]) values ('1', '1', 1, 1, 0, 1, 1) when matched update set [read]=1, write=1, readonly=0, modify=1, admin=1 ; edit: pls check comment @ bottom, below improved query...

c - return a static structure in a function -

c89 gcc (gcc) 4.7.2 hello, i maintaining someones software , found function returns address of static structure. should ok static indicate global address of structure available until program terminates. driver_api(driver_t*) driver_instance_get(void) { static struct tag_driver driver = { /* elements initialized here */ }; return &driver; } used this: driver_t *driver = null; driver = driver_instance_get(); the driver variable used throughout program until terminates. some questions: is practice this? is there difference declaring static outside function @ file level? why not pass memory pool function , allocate memory structure structure declared on heap? many suggestions, generally, no. makes function non-reentrable. can used restraint in situations when code author knows doing. declaring outside pollute file-level namespace struct object's name. since direct access the object not needed anywhere else, makes more sense ...

xcode - how can form a user in put with text field and without a button -

i want form textfield in view controller. after user make input text field , press return or dismiss keyboard touching screen, action must done. how can implement that? want code executed making global variable when keyboard dismiss: [(appdelegate *)[[uiapplication sharedapplication] delegate] somevariable:somevariabletextfield]; note: somevariable number if there no way form nsnumber variable textfield can use nsnumberformatter. pressing return call "did end , exit" event,so can ctrl-drag uitextfield code,and implement method.

computer vision - Image labeling performance using CRF -

i need develop image labeling application, task i'm considering using conditional random fields (crf) on set of superpixels, there exists quite few papers point out technology state of art task. usual task devided 2 tasks: training model: problem obtaining parameter vector 'w', using example testing: obtaining feasible label assignment of given set of superpixels, i.e argmax(p(y|x)) i'm aware of training-time quite high, have not found testing-time nor performance, have , idea of how time take testing problem? suppose depend on number of labels, image size, implementation, hardware, etc testing slowish because still have solve graph cuts problem (but nothing training). there implementation can try out @ http://drwn.anu.edu.au/drwnprojmultiseg.html (you have seen stephen gould's papers). i still have log file. bit hard interpret following may not totally accurate. on super fast machine, think took about: 4.5 hours cpu time train 20 classes ...

django - Can portions of a python web app be secure while others are not? -

this question has answer here: serving secure django pages https 1 answer i looking @ switching python/django web development. of application need port have admin sections of site being served on ssl while main interface not. is there way serve admin portion of django app on ssl while rest of site on http? its possible. if using nginx , how it: under /etc/nginx/sites-available/default , add following below server tag , configure files appropriately: #ssl support added listen 443 ssl; ssl_certificate /etc/ssl/ssl/nginx/server.crt; ssl_certificate_key /etc/ssl/ssl/nginx/server.key; ssl_protocols sslv3 tlsv1 tlsv1.1 tlsv1.2; ssl_ciphers high:!anull:!md5; then in middleware.py, class securerequiredmiddleware(object): def __init__(self): self.paths = getattr(settings, 'secure_required_paths...

C++ zLib compress byte array -

i want compress byte array zlib , here code : void cggcbotdlg::onbnclickedbuttoncompress() { // todo: add control notification handler code here z_const char hello[] = "hello, hello!"; byte *compr; ulong comprlen; int returncode; ulong length = (ulong)strlen(hello)+1; returncode = compress(compr, &comprlen, (const bytef*)hello, length); } but returncode returns -2 (z_stream_error) took code directly zlib example codes (example.c), works on own example program , returns 0 (z_ok) there in program returns -2 appreciated you need allocate compression buffer , send size first 2 params, so: byte compr[somereasonablesize]; ulong comprlen = sizeof(compr); ...

javascript - How to load a public function using QUnit and TypeScript -

Image
i using qunit test typescript code , fine when run simple example this: http://thomasardal.com/testing-typescript-with-typescript-using-qunit-and-chutzpah/ but nightmare start when try create unit tests spa app. @ moment run testing using chutzpah on vs got strange error: "can't find variable home in mypath\home.tests.ts(line6). my code bellow: home.ts import logger = module('services/logger'); export var title = 'home view'; export function activate() { logger.log('home view activated', null, 'home', true); return true; } home.tests.ts /// <reference path="../../scripts/qunit.d.ts" /> qunit.module("home.ts tests"); import home = module("home"); test("test title home viewmodel", function () { // calling active public function home viewmodel. (home.ts) var activateresult:string = home.title; // assert equal(activateresult, "home view", "re...

Oracle Apex Flash Chart not displaying label -

i building stacked column 3d flash chart in oracle apex. based on pl/sql returning sql query. pl/sql required capture types of properties , count number of instances in database connected properties. code : declare l_qry varchar2(32767); v_id number; v_resort varchar2(80); begin l_qry := 'select ''fp=&app_id.:802::app_session::::p5_search_month:''||to_char(e.enquired_date,''mon-yy'')||'':'' link,'; l_qry := l_qry || ''' ''||to_char(e.enquired_date,''mon-yy'')||'':'' label,'; --loop through resorts , add sum(decode...) column column alias r1 in (select distinct a.resort_id enquiry a, resort b a.resort_id not null , a.resort_id = b.id , b.active =1) loop select name v_resort resort id = r1.resort_id; what happens plsql loping through resorts , counts them. solution work degree after value returned want have label nam...

jquery - Finding a Javascript Event that Blocks All Others -

i working on project uses plupload library. after upload files using plupload, further jquery events on page stop working (including dropdown menu, datatables, , few other elements .live("click" ). i have spent many hours stepping through script in chrome console , have not found cause problem. i think entire code post here, looking suggestions of cause or put breakpoints figure out. edit: based on suggestions/answers below, here offending code: uploader.bind('fileuploaded', function(up, file, response) { uploadsuccess(file, response.response); }); function uploadsuccess(fileobj, serverdata) { var item = jquery('#upload-item-' + fileobj.id); // on success serverdata should numeric, fix bug in html4 runtime returning serverdata wrapped in <pre> tag serverdata = serverdata.replace(/^<pre>(\d+)<\/pre>$/, '$1'); if ( serverdata.match(/upload-error|error-div/) ) { item.html(serverdata); ...

Downloading Multiple Files via SFTP using Java -

i new java , trying write script pull multiple files various sftp sites daily. i have code below pull 1 file 1 site , works, struggling find how modify code download multiple files. example files in remote directory, or files containing letters can advise me on please? code:- package package1; import java.io.bufferedinputstream; import java.io.bufferedoutputstream; import java.io.file; import java.io.fileoutputstream; import java.io.outputstream; import com.jcraft.jsch.channel; import com.jcraft.jsch.channelsftp; import com.jcraft.jsch.jsch; import com.jcraft.jsch.session; public class sftppullsshkeys { public sftppullsshkeys() { } public static void main(string[] args) { string sftphost = "ip"; int sftpport = 22; string sftpuser = "username"; string passphrase = "passphrase"; string sftpworkingdir = "remote directory"; ...

oracle - SQL Developer pivot with unknown number of values into one column -

i've been trying figure out how use pivot function in sql developer 1 query i'm trying do. didn't find me previous posts hoping me out. a small section of data need select looks this: | id | name | country | state | date | type | amount | +----+------+---------+-------+------+--------+--------+ | 1 | john | u.s. | tx | 345 | red | 76 | | 1 | john | u.s. | tx | 345 | blue | 357 | | 2 | alex | u.s. | co | 654 | red | 231 | | 2 | alex | u.s. | co | 654 | black | 90 | | 2 | alex | u.s. | co | 654 | blue | 123 | | 2 | alex | u.s. | co | 654 | red | 456 | | 1 | john | u.s. | tx | 345 | gold | 60 | | 1 | john | u.s. | tx | 345 | silver | 70 | i need have each different type own column above becomes: | id | name | country | state | date | red | blue | black | other | +----+------+---------+-------+------+-----+------+--------+--------+ | 1 | john | u.s. | ...

android - Maven 3 "uber jar" how to embed a jar within a jar? -

this has been killing me day. working on android / java in eclipse. this want do i want embed 1 of libraries - databaselibrary within of libraries - logiclibrary crucially - without exposing of methods in databaselibrary 3rd party has access logiclibrary. i have tried including using proguard-maven-plugin this <configuration> <assembly> <inclusions> <inclusion> <groupid>xxx</groupid><artifactid>databaselibrary</artifactid><library>true</library> </inclusion> </inclusions> </assembly> however includes methods databaselibrary , exposed them 3rd party. i want logiclibrary able call against databaselibrary without 3rd party ever seeing it. i have searched on web , seems called uber jar need do. have tried few methods such maven-assembly-plugin mentioned here ...

javascript - jQuery value pick up -

this code: <input type="text" id="name" /> <script> var name = $("#name").val(); </script> after page loaded, type in value in input box. type in chrome console after value console.log(name); i empty string use: <input type="text" id="name" /> <script> $(document).on('keyup', '#name', function(){ name = $(this).val(); }); </script> this assign value of #name variable name once value has been typed in.

removeclass - Fade out and remove a <div> -

how can fade out following? need removed completely, not alpha 0 display:none , visibility:hidden after fade out. fiddle: http://jsfiddle.net/fourroses666/ywmux/2/ js: <script type="text/javascript" language="javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script> <script type="text/javascript"> $('.go-away').click(function() { $('.message').removeclass('show'); }); </script> css: <style> .message{display:none; visibility:hidden;} .message.show{display:block; visibility:visible;} .go-away{float:right; cursor:pointer; cursor:hand;} </style> html: <div class="message show">pizza nice! <div class="go-away">x</div></div> try this $('.go-away').click(function() { $(this).parent().fadeout(); });

How can you run a remote GWT application in eclipse -

i have gwt project on vm (it uses maven) it's not hosted on google servers. i've imported using eclipse's "remote services" cannot launch gwt app. is there way in eclipse (or ide)? you need gwt eclipse plugin maven gwt plugin. here find detailed explanation how set up: http://uptick.com.au/content/getting-started-gwt-maven-and-eclipse

sql - Getting Rows in the form of Column Names -

input table format in sql server 2008 : *name* *department* 1) abcd 2) abcd ctech 3) abcd mech 4) uvw sap 5) uvw informatica desired output result: name department1 department2 1) abcd ctech 2) uvw sap informatica above scenario sql server 2008 table... can me output result format shown? there several ways transform data columns. you can use aggregate function case expression: select name, max(case when rn = 1 department end) department1, max(case when rn = 2 department end) department2, max(case when rn = 3 department end) department3 ( select name, department, row_number() over(partition name order department) rn ...

c# - Removing part of a namespace across entire project -

i know can rename namespace using visual studio 2010, need remove part of namespace. namespace xyz.common.utils { ... } renamed to namespace common.utils { ... } i need drop xyz part, don't see way use vs refactoring tool this. this did few times , don't need third-party tool. refactor name in unique like: fjhfhchdbyegdrkoksodbc (if that's unique enough you) than global replace on fjhfhchdbyegdrkoksodbc. (including dot) empty string.

javascript - How can I set a unique indentifier on HTML gadgets, when I can't use ID and need to reference the gadget repeatedly? -

i'm using plugin (called renderjs ) allows build html pages reusable gadgets (html5 mashups). default gadget this: <div id="header" data-gadget-module="header" data-gadget="html/modules/header.html"></div> the plugin keeps index of gadgets, making invidiual gadgets accessible through id=header" , under gadget stored in gadgetindex. my problem is, i'm using along jquerymobile , i'm no friend of using id-attributes since want instantiate , re-use gadgets (like above, should go on every page). i have checked instantiation inside jqm , jqueryui (both using jquery ui widget factory ) among other things assigns every widget instance unique uuid . my question : how best set unique indentifier on resuable gadgtes, if these have referenced often? i assign running counter on every gadget i'm creating , assign somewhere on gadget-proto-object, since need reference gadgets uuid lot , have manage gadget state th...

ruby - I need to display results from time_ago_in_words as "days ago" only -

when pass rails time_ago_in_words method date greater 1 month ago, returns string reads "about n months old". is there anyway have method return distance date paramater in days i.e. 30 days ago, 50 days ago, 90 days ago etc... class time def days_ago diff = time.now - self return ago if diff < 86400 "#{"day".pluralize(diff.to_i / 86400)} ago" end end class date def days_ago to_time.days_ago end end or helper: def days_ago(date) diff = time.now - date.to_time return date.ago if diff < 86400 "#{"day".pluralize(diff.to_i / 86400)} ago" end

django - localeurl with django1.5 -

i migrated django 1.5 , since have problem {% url "localeurl_change_locale"%} . in fact have form: <form id="ch_lg" method="post" action="{% url "localeurl_change_locale" %}"> {% csrf_token %} <select id="country-options" name="locale" onchange="$('#locale_switcher').submit()"> {% lang in languages %} <option value="{{ lang.0 }}" {% ifequal lang.0 language_code %}selected="selected"{% endifequal %}>{{ lang.1 }}</option> {% endfor %} </select> <noscript> <input type="submit" value="set" /> </noscript> </form> it worked perfectly, since url change, have problem @ action {% url "localeurl_change_locale"%} . after research don't understand do. thank you i found answer ... didn't add locale_paths ...

javascript - Uncaught RangeError: Maximum call stack size exceeded with innerHTML -

i'm not experienced javascript, i'm running issue can't understand. code simple: document.getelementbyid ('chat_line_list').addeventlistener ("domsubtreemodified", localmain, false); function localmain () { var chatlist = document.getelementbyid('chat_line_list').lastchild.lastelementchild.innerhtml; chatlist = chatlist.replace('infothump', '<span class="newemo-1 emoticon"></span>'); chatlist = chatlist.replace('muskmelon', '<span class="newemo-2 emoticon"></span>'); chatlist = chatlist.replace('poisonapple', '<span class="newemo-3 emoticon"></span>'); chatlist = chatlist.replace('poisonbanana', '<span class="newemo-4 emoticon"></span>'); chatlist = chatlist.replace('poisonwatermelon', '<span class="newemo-5 emoticon"></span>'); ...

user interface - Visual Studio 2012 UI Bug Fix? -

Image
i having issues visual studio 2012 ui. when try perform various functions (quickwatch, break point conditions, etc) text boxes in ui filled scrambled images , cannot type legible them. anyone experiencing similar behavior , know how fix it? means these functions useless me right now. go tools --> options --> environment --> general unselect automatically adjust visual experience based on client performance unselect use hardware graphics acceleration if available. problem solved.

imagemagick - Image Magick and Imagick - not working from php script but fine on cmd line -

i have following setup: home brew installed imagemagick (v 6.8.0-10) source installed imagick (v 3.0.1) os x 10.6 imagemagick working fine on command line not php script using imagick class. the following code produces error nodecodedelegateforthisimageformat : $img = new imagick('test.pdf'); the imagick module enabled in php.ini imagemagick version listed in php info as: imagemagick 6.8.0-7 2013-04-11 q16 the version installed version listed above ends in -10 not -7. factor? if can convert command line i'm not missing delegates must else.

ios - uisplitviewcontroller: passing selected row from master to detail -

it's couple of days i've been struggling uisplitviewcontrollers, here's problem: have master view declared follows #import <uikit/uikit.h> #import "detailviewcontroller.h" @class detailviewcontroller; @interface masterviewcontroller : uitableviewcontroller { nsmutablearray *title, *subtitle; unsigned int quantity; } @property (strong, nonatomic) detailviewcontroller *detailviewcontroller; @end in master's .m file works correctly (i'm able populate table sqlite db , show contents in rows). when comes select 1 row , populate detailed view on right side nothing happens. here row selection: - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { myobject itemfromdb; /* ... db stuff here ... */ self.detailviewcontroller.detailitem = itemfromdb; } here's detailviewcontroller implementation: @interface detailviewcontroller : uiviewcontroller <uisplitviewcontroller...

python - Filedialogue error in Tkinter -

question tkinter : i want create browse along text display display file pick browse button. following code : edit 1. button_opt = {'fill': tkconstants.both, 'padx': 5, 'pady': 5} tkinter.button(self, text='browse , open filename - manually upload it', command=self.askopenfilename).pack(**button_opt) self.file_opt = options = {} options['defaultextension'] = '.txt' options['filetypes'] = [('all files', '.*'), ('text files', '.txt')] options['initialdir'] = 'c:\\' options['initialfile'] = 'myfile.txt' options['parent'] = root options['title'] = 'browse' self.dir_opt = options = {} options['initialdir'] = 'c:\\' options['mustexist'] = false options['parent'] = root options['title'] = 'browse' image = image.open(...

jquery instant search based on keywords -

this plugin uses regular expression sort content, in real-time, based on search input. right script searching type. here code: $.fn.simplecontentsearch = function ( options ) { var settings = { 'active' : 'active', 'normal' : 'normal', 'searchlist' : 'searchable tr', 'searchitem' : 'td', 'effect' : 'none' // fade, none }; var base = this; var options = $.extend(settings, options); function startsearching(query) { $( '.' + settings.searchlist ).each(function () { $(this).children( settings.searchitem ).each(function () { var elem = $(this); if (!elem.html().match(new regexp('.*?' + query + '.*?', 'i'))) { if( settings.effect == 'fade' ){ $(this).parent( '.' + settings.searchlist ).fadeout(); } else { $(...

api - How would I reference a user account on bigcommerce so that they don't need 2 logins? -

i have shop.domain.com... in www.domain.com have social stuff going on blog, etc. want users able post comments on blog, , use social features without having maintain 2 separate logins. can/should use webhook capture info when register , send way? i don't believe webhooks intended attempting do. if @ events bigcommerce webhooks support http://developer.bigcommerce.com/api/webhooks/quickstart the majority of events transactional. can subscribe events when customer created, there no way notification when logs store. can't include custom javascript in store template lets connect facebook or twitter account, can used comment on blog?

.htaccess - PHP Filename Parameter -

i have seen various sites defining products name in url ... example http://www.webesite.co.uk/hp/hp-c9701a-cyan-toner-cartridge-original instead of http://www.webesite.co.uk/product.php?product=hp-c9701a-cyan-toner-cartridge-original i aware , have used lot $_get function parameters specified in url after .php file tag, question how provide parameter replace file name rather specifying @ end of file name? i'm working in php i'm not sure if achieved using .htaccess file i interested know perform best seo wise??? yes need use mod_rewrite .htaccess redirect correct resource. here usefull link explaim better need in .htaccess: http://zenverse.net/seo-friendly-urls-with-htaccess/ and here similar thread in stackoverflow: how create friendly url in php?

HEAP CORRUPTION DETECTED in C -

i having problems program , getting error : heap corruption detected: before normal block (#9873672) @ 0x00968988. crt detected application wrote memory before start of heap buffer. i have tried fixes can't figure out wrong program, fix , :( here function i'm using , causing me problems : doing file specific keyword (argument of function gettext) , printing matching value. sorry if of variables in french, it's project school , our teacher require use french names >_< #include "gettext.h" #include "main.h" #include <stdlib.h> textelangue* ressourcestextelangue = null; int compteur = 0; char* gettext(char* clef) { char* texte = null; texte = clef; //clef keyword passed in function argument textelangue temp; temp.clef = clef; textelangue* resultat = (textelangue*) bsearch(&temp, ressourcestextelangue, compteur, sizeof(textelangue), comparerclef); //returns value associated key if (clef != null) { ...

javascript - Where do I need a closure for this one? -

i have constructor: var editableitem = (function() { function editableitem(schema, item) { this.schema = _.clone(schema); this.item = _.clone(item); this.propertytypes = [ 'stringproperties', 'booleanproperties']; } editableitem.prototype = { createitem: function() { var self = this; self.propertytypes.foreach(function(type) { var properties = self.schema[type]; properties.foreach(function(property, i) { var itemproperty = self.item[type][property.id]; if (itemproperty) { properties[i].value = itemproperty; } }); }); self.schema.itemid = self.item._id; return self.schema; } }; return editableitem; })(); and each time use it, this... async.parallel({ schema: function(callback) { ...

show hide - Having issues with multiple hidden/revealed DIVs using JQuery -

i creating page website there vertical navigation bar, , upon clicking on menu items/submenu items on said navigation bar, different divs hidden/revealed, showing , hiding different products. so far, have gotten showing/hiding of main menu items work upon clicking them. example: click on "first item" link @ top of menu, , grid of first item images show next navigation bar. click on "second menu item", , first images vanish, , second item images appear, etc. however, have run trouble is, reason, when click on 1 of submenu items, images show up, can't corresponding main menu item's images disappear. here's code main menu/sub menu issue: html <ul class="accordion"> <li class="item1"> <a href="#">product category 1</a> <ul> <li class="sub1"><a href="#">sub 1 </a></li> </ul> </li> ...

php - Changing background image src periodically using jQuery and AJAX -

i'm trying have background image of body of page change every (approximatly) n seconds. have php function echoes random image src when call using ajax. replace current body background image src newly generated one, can't work. here code, there wrong in ? (function($) { var $body = $('body'); window.setinterval(function() { $.ajax({ url: 'http://localhost/some_path/index.php?exec=getnewbkgimgsrc', }).done(function(data) { var newimage = new image(); newimage.onload = function() { $body.css('background-image', newimage.src); }; newimage.src = data; }); }, 5000); })(window.jquery); and php function work : public function getnewbkgimgsrc() { echo content_url_dir.'/wallpapers/wallpaper ('.rand(1, 20).').jpg'; } could because i'm using localhost ? can mremeber having ajax problems before when developping local...

php - Alternative syntax for do-while loop (using colon) -

the manual has references alternative syntax control structures using colons, don't see 1 do-while loop. possible so? this: //simple example $arr = array(1,2,3,4,5,6); $i = 0; : echo $arr[$i].'<br/>'; $i++; while($i < count($arr)) endwhile; from manual :- there 1 syntax do-while loops: $i = 0; { echo $i; } while ($i > 0);

php - Jquery Pagination page number limiting -

i have functional pagination built have issue amount of data returned making pagination large. have read through lot of posts issue , havent found decently close thought needed. looking pagination bar limit pages. prev 1 2 3 4 5 6 . . . 11 next prev 1 . . . 6 7 8 9 10 11 next jquery $(function() { //manage users table , search form js start //loads table page 1 upon loading page. load_table(1); /*$("#users_table").tablesorter({ debug: true }); */ //upon search being clicked table loads @ first page of result set. $('#user_search_btn').click(function() { load_table(1); }); //global var clicking of pages , prev , next buttons. var page = 1; $('a.page_link').live('click', function() { //gets number assigned data-page , puts in page var. load table page page = $(this).data('page'); load_table(page); }); $('#prev').live('click...