Posts

Showing posts from May, 2012

php - Trying to show jqmobile grid(trirand) in a jquery mobile windows -

using jquery mobile want pop dialog box user can enter in search filters , when submit query show jqmobile grid(trirand) inside modal window. possible. here code below: qr.php <?php require_once '../auth.php'; require_once '../jqsuitephp/jq-config.php'; // include pdo driver class require_once '../../jqsuitephp/php/jqgridpdo.php'; // connection server $conn = new pdo(db_dsn,db_user,db_password); // tell db use utf-8 $conn->query("set names utf8"); if(isset($_request['a'])) { //get asset information $conn = new pdo(db_dsn,db_user,db_password); $sql = "select asset_no, dept_id dept, short_desc, `loto #` loto mfg_eng_common.machine asset_no ='".$_request['a']."'"; $result = $conn->query($sql); $row = $result->fetch(pdo::fetch_assoc); //check see if active work order exists in mwo system current asset //status_id of 50 mean approved/closed $sql = "select count(*) wocnt mfg_eng_mwo.mwo ass

c++ - Should std::array have move constructor? -

moving can't implemented efficiently (o(1)) on std::array, why have move constructor ? std::array has compiler generated move constructor, allows elements of 1 instance moved another. handy if elements efficiently moveable or if movable: #include <array> #include <iostream> struct foo { foo()=default; foo(foo&&) { std::cout << "foo(foo&&)\n"; } foo& operator=(foo&&) { std::cout << "operator=(foo&&)\n"; return *this; } }; int main() { std::array<foo, 10> a; std::array<foo, 10> b = std::move(a); } so std::array should have move copy constructor, specially since comes free. not have 1 require actively disabled, , cannot see benefit in that.

How to know a code in php run sucessfully or not -

i have fallowing code <html> <body> <?php if ($_get['run']) { # code run if ?run=true set. echo "hello"; exec ("chmod a+x ps.sh"); exec ("sh ps.sh"); } ?> <!-- link add ?run=true url, myfilename.php?run=true --> <a href="?run=true">click me!</a> now want know exec ("chmod a+x ps.sh") executing or not. should do?? exec(..., $output, $return); if ($return != 0) { // went wrong } capture return code supplying variable name third parameter. if variable contains 0 afterwards, good. if it's other 0 , went wrong.

java - Android Service Classpath -

i'm building application starts service uses internal android .jar file located @ /system/framework the problem whenever try access class .jar file, classdefnotfound exception. note: i'm able compile project stub 'd version of .jar file, don't know how include internal library in application (service) classpath rid of exception. (i'm not using eclipse) add androidmanifest.xml <uses-library android:name="com.android.library" /> from android documentation: http://developer.android.com/guide/topics/manifest/uses-library-element.html this element tells system include library's code in class loader package.

drupal 7 - Ccontent entity reference field storing entity ID in form, not value from view -

i trying use entity reference field in content type uses views filter limit fields in entity , place them in select list in new content form. works fine. when publish form, saves entity id - not values view returned select box. need in drupal ui include in features override. does know how accomplish this? thing have come entity reference view widget module, maintainer has placed note on module page stating should not used. here appreciated. you can try entityreference_dynamicselect_widget module . in case 2562 sites using entity reference view widget module add value module.

hibernate - How do I calculate the anniversary date in JPQL -

i'm using jpa2 i have queried in ms access in following way for example, find out anniversary in 2 years: select dateadd(year, 2, initialdate) anniv or find out how many years have passed since initial date: select datediff(year, initialdate, getdate()) yearspassed i'm not able find function in dateadd in jpql could 1 please me getting similar effect in jpql hibernate session provides dowork() method gives direct access java.sql.connection . can create , use java.sql.callablestatement execute function. here oracledb function example: session.dowork(new work() { public void execute(connection connection) throws sqlexception { callablestatement call = connection.preparecall("{ ? = call myschema.myfunc(?,?) }"); call.registeroutparameter( 1, types.integer ); // or whatever call.setlong(2, id); call.setlong(3, transid); call.execute(); int result = call.getint(1); // propagate enclosing class } }); or calcula

groovy - Sending an email: no object DCH for MIME type multipart/mixed -

i'm trying send email using java code running groovyconsole. works fine when send email without attachments fails add in multipart logic attachments. edit: i'm using javamail version 1.4.7 this error i'm getting. javax.activation.unsupporteddatatypeexception: no object dch mime type multipart/mixed; boundary="----=_part_16_24710054.1375885523061" @ javax.activation.objectdatacontenthandler.writeto(datahandler.java:891) and it's happening on line transport.send(mimemsg) below. import java.util.properties; import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; properties properties = new properties() session session mimemessage mimemsg properties.put("mail.smtp.host", "[my host ip]") session = session.getdefaultinstance(properties) mimemsg = new mimemessage(session) string recipient = "[to email address]" mimemsg.addrecipient(message.recipienttype.to, new internetaddress(recipient)) mi

PHP include: failed to open stream: no such file in "/literally/the/exact/location/of/the/file"? -

so while trying include file in php, using include(/users/leonaves/sites/mysite/admin/inc/pages/dashboard.php) (i'm running locally), php tells me: failed open stream: no such file or directory in /users/leonaves/sites/mysite/admin/inc/page_request.php on line 86. i have tried including relative path, absolute path, declaring root in variable etc. etc. have no idea how make file include other. php refuses find @ exact location is. amazing, thank you. php executes scripts found in directories specified in open_basedir . path not allowed.

android - Get values of views inside listview item on click -

i have listview containing different xml layouts, each different views. wondering how can data views inside item user has clicked on, inside onitemclick method. my listview made of multiple layouts cannot know sure layout being pressed when onitemclick method called. example, 1 of items in layouts in listview is: // list_item.xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <textview android:id="@+id/lblsub" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:padding="6dp" android:layout_marginright="4dp" android:text="" android:textcolor="#ffffff" android:text

jquery - resend ajax request changing only one attribute -

i want make ajax request in success function need pass different 'guidlist'. $.ajax({ url: "my.ashx", datatype: 'json', type: 'post', data: { cmd: 3, //poll database job status guidlist: guidlist }, success: function(){ $.ajax(this);<-all same except need change passing in guidlist } }) create function send request - recursively call inside success handler. careful though avoid infinite loops. function sendrequest(param) { $.ajax({ url: "my.ashx", datatype: 'json', type: 'post', data: { cmd: 3, //poll database job status guidlist: param }, success: function(){ if(param == [something]) sendrequest(newparam); } }); } sendrequest(guidlist);

xml - Escape developer name umlauts in a Maven POM file? -

in <developers> section of pom.xml , if name contains non-7-bit-ascii characters, e.g. german umlauts ( ä ) or french accents ( é )—do need escape them somehow? because if view file mozilla, error: xml parsing error: undefined entity <name>foo b&eacute;r</name> -----------------------^ should type accents such , assume maven uses utf-8 decoding? one cannot use html named entities in xml. use utf-8 , full wysiwig. if encoding not listed in defaults utf-8.

javascript - How to dynamically change a combobox's searchAttr based on a radio button in dojo? -

i trying change value of searchattr of combo box based on radio button. here working snippet of have far. <html> <head> <title>test</title> <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dijit/themes/claro/claro.css"> <script> dojoconfig = { parseonload: true } </script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script> <script type="text/javascript"> require([ "dojo/store/memory", "dijit/form/combobox", "dojo/domready!" ], function(memory, combobox) { var infostore = new memory({ data: [{ "prop1": "a1", "prop2": "a2" }, { "prop1": "b1", "prop2": "b2"

ios - Unreleased xcdatamodel versions and lightweight migration -

if have multiple unreleased xcdatamodel versions between release , release b, lightweight migration still work once release public if delete unreleased versions? here's more discrete example: xcdatamodel version 1.0 --> release public xcdatamodel version 1.1 --> unreleased (based on v1.0) xcdatamodel version 1.2 --> unreleased (based on v1.1) xcdatamodel version 1.3 --> release public b (based on v1.2) i want make sure when submit release b, users coming release migrated properly. or terrible way go it? understand if didn't care data on testing devices, base xcdatamodel version 1.3 on version 1.0 , put new in version - don't want lose data on testing devices have had versions of app v1.1 , v1.2 on device. thanks! assuming format used existing user data can converted current format via automatic lightweight migration, doesn't matter created internal, unreleased versions. what need include in released app: every version user might

excel 2010 - Varying validation drop-downs based on varying cell values -

i attempting have cells in column “u” deliver different drop-down menus based on corresponding value in column “d”. have created 7 named lists: list_117g list_152 list_jmet list_xband list_pacwind list_vortex list_rover those lists called based on 7 values in column “d”: g 152 j x d/e v r so far have been able work first category g . when change value of column d g 152 no longer drop-down. here formula using in list function of validation. =if(d6="g",list_117g,if(d6="152",list_152,if(d6="j",list_jmet,if(d6="x",list_xband,if(d6="d/e",list_pacwind,if(d6="v",list_vortex,if(d6="r",list_rover,))))))) what doing wrong? when type '152' cell, stored number. can change format of number (e.g. display currency, percentage, date, text, etc), value number unless use text formula display text. in if statement, if want compare cell value number, can't have quotes around it. example:

excel vba - VBA Copy IF Value Equals -

i wonder whether may able me please. firstly, i'm first admit, i've received stage, i'm little unsure past issue have code below. to give little background: what i'm trying do, perform check code looks @ list of projects on sheet "alldata" (source) sheet, starting @ cell e3, , copies cell if contains text value "enhancements" , pastes "enhancements" (destination) sheet. in addition, code takes 'actuals' manhour figure , date associated each project , totals manhours project , period respective cells on destination sheet (enhancements sheet). these "rval" , "rdate" variables. revised code - full working script sub extract() dim long, j long, m long dim strproject string dim rdate date dim rval single dim blnprojexists boolean sheets("enhancements").range("b3") = 1 .currentregion.rows.count - 1 j = 0 13 .offset(i, j) = "&qu

sql server 2008 r2 - Returning Output Paramters or Variables From SSIS Script Task / Script Component -

Image
is possible return output parameters ssis "script task" has been called stored procedure using xp_cmdshell? all samples have found far show how assign values dts package variables etc; , show them via message box every single sample see shows script task returning dts.taskresult = (int)scriptresults.success; or dts.taskresult = (int)scriptresults.failure ... basically, have script task gets several values dll call works anticipated; values verified message boxes; have not been able ferret out how return stored procedure executed ssis package. am missing obvious? please provide functional code example & or screen shots of control flow / data flow, etc., of how end end... e.g.: stored procedure -> execute *.dtsx package, passing parameters, including output parameters; , how same stored procedure can read output parameters in type of call; when results returned... thanks in advance. i don't know if possible return values in script task calling st

pyhook - How to find files and save them to different folder in python -

i amt trying find relevant files , folders local repository. e.g. pulled projects git local machine , want search specific files(.txt) , save them new folder in same pattern (root->dir-> file). want rid of files doesn't match name , extension keep same format. in advance. you can traverse directory tree finding files want this: import os, fnmatch def find_files(directory, pattern): root, dirs, files in os.walk(directory): basename in files: if fnmatch.fnmatch(basename, pattern): filename = os.path.join(root, basename) yield filename def find_files_to_list(directory, pattern): file_list = [] root, dirs, files in os.walk(directory): basename in files: if fnmatch.fnmatch(basename, pattern): filename = os.path.join(root, basename) file_list.append(filename) return file_list then copy repository , this: wanted_files = find_files_to_list(

devexpress - Delphi: Name of Method that is called for updating content of TxcDateEdit (or TEdit) control needed -

Image
i'm writing routine checks input of tcxdateedit (from devexpress). after number typed in, should check , try autocomplete rest of content. in case, if user types in day in empty tcxdateedit control should automatically fill in current month , year. the problem need fire autocompletion method after number typed user , visually added in tcxdateedit control. can check actual input. i'm searching name of method used control update tcxdateedit . don't mean method implies focus lost, mean method called typing in control after (or while) each typed key added string variable content of control. i'm pretty sure similar method exists in common tedit control. if tell me name of method thankful. thanks in advanced! what ask possible using onchange event of properties , shown in following image using event , editingtext property edit, can use following code: uses dateutils, strutils; procedure tform1.cxdateedit1propertieschange(sender: tobject); var mo

quickfix - How to request a replay of an already received fix message -

i have application potentitally throw error on receiving executionreport (35=8) message. error thrown @ application level , not @ fix engine level. fix engine records message seen , therefore not send resendrequest (35=2). application has not processed , manually trigger re-processing of missed executionreport. forcing resendrequest (35=2) not work requires modifying expected next sequence number. i wonderin if fix supports replaying of messages without requiring sequence number reset? when processing execution report, should not throw exceptions , expect fix library handle it. either process report or have system failure (i.e. call abort() ). therefore, if code handles execution report throws exception , know how handle it, catch in same function, eliminate cause of problem , try processing again. example (pseudo-code): // function called fix library. no exceptions must thrown because // fix library has no idea them. void on_exec_report(const fix::msg &msg) {

java - why does my textArea not work in real time? -

i trying append string client program. made append statement in while loop. have affect in not working in real time? for areas tffixmsg.append( inputline + "\n\n\n"); and tfcsvline.append(outputline+"\n\n\n"); it not show message on textarea until while loop done. how can make continue recieve messages client, , able output onto textarea in realtime try { while ((inputline = in.readline()) != null) { system.out.println ("server: " + inputline); tffixmsg.append( inputline + "\n\n\n"); int pos = inputline.indexof(inputline, 0); h.addhighlight(50, 60, defaulthighlighter.defaultpainter); if (inputline.trim().equals("bye.")) { system.out.println("exit program"); break; } scanner input1 = new scanner(new file(csvname)); scanner input2 = new scanner(new file(cs

java - Powershell outputting malformed filenames -

i'm using command: get-childitem | foreach-object {$_.basename} > file_names.txt to print file names in current directory file (without final extensions). opening file names in notepad shows file names printed. simple enough, yes. cool. my problem on reading file names in bufferedreader in java, file names coming malformed. example, 20100916_090350_s1_1_auto gain test_1.rad comes ÿþ2 0 1 0 0 9 1 6 _ s 1 _ 1 _ u t o g n t e s t _ 1 . r d (the .rad extension should there, there extension after wanted removed) i assume type of silly windows encoding issue. unfortunately, know nothing these sorts of things. on appreciated. thanks powershell default emits unicode, , characters see @ beginning called bom (byte order mark). can either force java read unicode, or force powershell output other encoding, preferrably default or oem of out-file parameter -encoding . summarize try this: get-childitem | foreach-object {$_.basename} | out-file -encoding

jquery - PHP, Singleton and $.ajax -

it seems $.ajax (jquery) doesn't work php singleton. i have simple class defined this: class mysingleton { protected static $instance = null; private $array; protected function __construct() { ... $this->array = array(); //get database, $this->array[] = object database; $this->array[] = object database; ... } protected function __clone() { } public static function getinstance() { if (!isset(static::$instance)) { static::$instance = new static; } return static::$instance; } public function somefunction() { $this->array[0]->somefield = "set without saving database"; ... } } i have helper.php file singleton object something. ie: <?php require "mysingleton.php"; $singleton = mysingleton::getinstance(); $singleton->somefunction(); $singleton->someotherfunction(); ?> in index.php

asp.net mvc 4 - Is this a bug in ServiceStack / Authentication? -

trying use servicestack authentication, , have re-direct login page follows: plugins.add(new authfeature( () => new customusersession(), //use own typed custom usersession type new iauthprovider[] { new credentialsauthprovider(), //html form post of username/password credentials new twitterauthprovider(appsettings), //sign-in twitter new facebookauthprovider(appsettings), //sign-in facebook new digestauthprovider(appsettings), //sign-in digest auth new basicauthprovider(), //sign-in basic auth new googleopenidoauthprovider(appsettings), //sign-in google openid new yahooopenidoauthprovider(appsettings), //sign-in yahoo openid new openidoauthprovider(appsettings), //sign-in custom openid }, "http://www.anyurihereisignored.com")); however uri argument

variables - How can I display an alert that shows the value of a var in javascript -

i have javascript file displays popup alert has value value of var must use: var errorsite = "web4all"; function displayerror{ alert("there has been error on " && var errorsite && "!") } i want have alert says: there has been error on web4all! just use + concatenate: alert("there has been error on " + errorsite + "!") note not use var keyword here, declare new "errorsite" variable (and not use existing 1 declared)!

css3 - Custom jQuery Mobile transition using -webkit-mask -

i trying make custom jquery mobile transition using -webkit-mask transition. here how i've set animation function: .mask.in { -webkit-mask-position: 0 0; -webkit-animation-name:maskinfromright; } .mask.out{ -webkit-mask-position: -100% 0; -webkit-animation-name:maskouttoleft; } .mask.in.reverse{ -webkit-mask-position: 0 0; -webkit-animation-name:maskinfromleft; } .mask.out.reverse{ -webkit-mask-position: 100% 0; -webkit-animation-name:maskouttoright; } @-webkit-keyframes maskinfromright { 0% { -webkit-mask-position:100% 0; } 100% { -webkit-mask-position:0 0; } } @-webkit-keyframes maskouttoleft { 0% { -webkit-mask-position:0 0; } 100% { -webkit-mask-position:-100% 0; } } @-webkit-keyframes maskinfromleft { 0% { -webkit-mask-position:-100% 0; } 100% { -webkit-mask-position:0 0; } } @-webkit-keyframes maskoutfromright { 0% { -webkit-mask-position:0 0; } 100% { -webkit-mask-position:100% 0; } } based on ex

Mobile Web Application Screen Orientation Design -

i'm designing user interface web page viewed on mobile device through device's browser. common design 2 interfaces, 1 portrait , 1 landscape? portrait view looks fine when flip landscape things of course stretched. ideas on best practice here? it common practice design 2 interfaces different window orientations. check window orientation. //listen resize changes window.addeventlistener("resize", function() { // screen size (inner/outerwidth, inner/outerheight) }, false); every time changes, apply different css classes portrait , landscape modes elements on web page.

awk - Replace fields with values of other fields in the same line -

i have kind of input: rs10000004 c t 4 rs10000004 0 75625312 c c c c t 0 c t rs10000005 g 4 rs10000005 0 75625355 g 0 a g a i want substitute columns 8 end "a" if value in column identical 2nd field $2 or "b" if value identical third field $3. else, value printed (zero values expected in columns) expected output rs10000004 c t 4 rs10000004 0 75625312 a a b 0 b rs10000005 g 4 rs10000005 0 75625355 0 b b b b b i tried following doesn't give me results empty lines. improving code better me show me new solution using other awk cat input | awk '{ for(i=8; i<=nf; i++) { if($i == $2) $i="a"; else if($i == $3) $i="b"; else $i == 0; } print $i }' thanks in advance code : awk ' { (i=8; i<=nf; i++) { if ($i == $2) { $i = "a"; } else { if ($i == $3) { $i = "b"; } else { $i = 0;

linux - Apache slowly builds up processes and kills server -

we have ubuntu server, running apache, php, , mysql. on time, seems number of apache processes increases (seen ps -aef , top commands). last night, bad server slow unusable. have no idea how processes started, since don't traffic. there many cron jobs running, never more 5-10 @ time. when first start apache, have usual 10 processes, on few hours doubles, morning when got in there 100. didn't run top command 100 processes, each 1 uses 10m-40m. i read prefork , worker mpms, , wondering if changing settings may help. using prefork default values. decrease maxclients kill processes? set number maxrequestsperchild they're killed sooner? or different?

string - Replace Non-Alphanumeric Characters in Oracle -

i trying convert string in oracle modified string compatible specific api. i leave alphanumeric characters intact, replace spaces + character, , replace special characters % plus hex code. for example, project 1: nuts & bolts should become project+1%3a+nuts+%26+bolts is there way using sql? i don't think can there plain sql without nested replace calls. can sample value utl_url.escape() function , because have pass second parameter , boolean, have in pl/sql block: set define off begin dbms_output.put_line(replace(utl_url.escape('project 1: nuts & bolts', true), '%20', '+')); end; / project+1%3a+nuts+%26+bolts the url_utl.escape function converts spaces %20 : project%201%3a%20nuts%20%26%20bolts ... , single replace call converts + . as ed gibbs said, can make function can @ least call plain sql: create or replace function my_escape(str in varchar2) return varchar2 begin return replace(utl_url.escape(

ruby on rails - How do I populate these fields? -

if go website https://www.cameralends.com/?utm_source=hackernews can click various drop downs. i'd know how populate fields data? e.g. there different camera models can choose etc... i know using code like: <% = a.select :categories, category.all.collect {|c| [c.name, c.id]}, :include_blank => true', :multiple => "multiple" %> will display them, how populate categories initially? if need add default set of values application, should use seeds . see railscast learn more them.

path - font awsome does not work when page is in a different folder -

this maybe trivial, has me puzzled. have basic font awsome sample; works fine when css , font folders @ same folder level page.html, when move page.html directory called "mysubdir", fonts not load. i've modified css reference shown below. tried changing path font in font-awesome.min.css file (although should not needed since relative paths in css relative css) did not make difference. ideas? <html lang="en"> <head> <link href="../mysubdir/css/font-awesome.min.css" rel="stylesheet"> </head> <body> <i class="icon-question-sign icon-white"></i> </body> </html> i got it. firefox not permit view file @ parent level unless change firefox settings.

c# - Get a error list after validate xml against a schema file -

i´m validating xml file against schema xsd. far good, code generates exception in case of failure. bool isvalid = true; list<string> errorlist = new list<string>(); try { xmlreadersettings settings = new xmlreadersettings(); settings.schemas.add(null, schemafilepath); settings.validationtype = validationtype.schema; xmldocument document = new xmldocument(); document.loadxml(xml); xmlreader rdr = xmlreader.create(new stringreader(document.innerxml), settings); while (rdr.read()) { } } catch (exception ex) { errorlist.add(ex.message); isvalid = false; } logerrors(errorlist); return isvalid; but need code build list of errors found in validate before send log, instead of show first 1 found. any thoughts? you can use validate method validationeventhandler . can follow ms

r - leading superscript in plotmath expression (w/ggplot2) -

Image
i'd use plotmath create axis containing leading superscript in ggplot2 plot. creating superscripts on axis labels works nicely, so: require(ggplot2) ggplot(mtcars, aes(x=disp, y=mpg)) + geom_point() + ylab(expression(x[y])) however, i'd have axis label read "y(superscript)x" - logically ^yx , won't parse: error: unexpected '^' in: " geom_point() + ylab(expression(^" is there way force superscript @ beginning of statement? how this: ggplot(mtcars, aes(x=disp, y=mpg)) + geom_point() + ylab(expression(phantom(0)^y * x)) i there must way "placeholder" character, had scroll down bit in ?plotmath find it.

.htaccess - one subdomain won't load on my local network, but the other will -

http://client.henrybuilt.com/ - won't load on network (network meaning internet connection) (even though can load on other networks) http://presentation.henrybuilt.com/ - loads on network both have same settings in control panel. my htaccess file: rewriteengine on rewritecond %{http_host} ^client.henrybuilt.com rewritecond %{request_uri} !subclient/ rewriterule ^(.*)$ subclient/$1 [l] rewriteengine on rewritecond %{http_host} ^presentation.henrybuilt.com rewritecond %{request_uri} !presentation/ rewriterule ^(.*)$ presentation/$1 [l] can duplicate issue or explain it? i know it's not information go off of, thought maybe know of method of debugging it.

gwt - How to Make a RichTextArea with the tool bar like in the samples -

i have searched on stackoverflow same question , found same question not fix problem answer question. anyways new gwt , when tried make richtextarea, thought make sample in http://www.gwtproject.org/doc/latest/refwidgetgallery.html (scroll down till see richtextarea) instead there plain text area without tool bar. how come there no tool bar in mine? can me , can show me how change code looks sample. figured might have formatter or getformatter method if can show me how that. here code: import com.google.gwt.core.client.entrypoint; import com.google.gwt.event.dom.client.clickevent; import com.google.gwt.event.dom.client.clickhandler; import com.google.gwt.user.client.ui.button; import com.google.gwt.user.client.ui.richtextarea; import com.google.gwt.user.client.ui.richtextarea.formatter; import com.google.gwt.user.client.ui.rootpanel; public class widgets implements entrypoint { private button btn; private button cbtn; private richtextarea textarea; public void onmod

Delete or remove all history, commits, and branches from a remote Git repo? -

i've read , tried lots of git command recommendations , discussion, going on over several days now. appears there no simple, comprehensive way make remote git repo empty -- no branches, no refs, no objects, no files, no nothing . yes, i recognize 1 delete , recreate repo -- if 1 had kind of permissions on origin (which don't), not point. how done? combination of git commands this, leaving repo in virgin state ready receive whatever wish push it, , with no size (or minimal size of virgin repo) ? please don't tell me shouldn't done, or have inform users, etc . know that. i want start fresh . you might want try pushing empty local repo --mirror flag (emphasis mine): --mirror instead of naming each ref push, specifies refs under refs/ (which includes not limited refs/heads/ , refs/remotes/ , , refs/tags/ ) mirrored remote repository. newly created local refs pushed remote end, locally updated refs force updated on remote end, , deleted ref

symfony - Can't generate routes trough FOSJsRoutingBundle -

i'm using ajax call trough $.ajax() in 1 of twig templates , because need call url i'm using fosjsroutingbundle . after read docs, follow every steps , write code in template: <script> $(function() { $("a.step").click(function() { var id = $(this).attr('id'); $.ajax({ type: 'get', url: routing.generate('category_subcategories', {parent_id: id}), datatype: "json", success: function(ev) { // here build next } }); }); }); </script> i got error in firebug console: referenceerror: routing not defined url: routing.generate('category_subcategories', {parent_id: id}), what wrong there? update the route @ php controller one: /** * subcategories based on $parent_id parameter * * @route("/category/subcategories/{category_id}", name="category_subcategories", options={"expos

c++ - evaluating a string in a condition -

how work string evaluate numbers coming condition? string = "(t>=2 && t<5) || (t<1)"; int c = 0; for(int t = 0; t < 10; t++){ if( {string} ) c++; } if it's qt write like qscriptengine e; e.globalobject().setproperty("t", 123); bool result = e.evaluate("(t>=2 && t<5) || (t<1)").tobool();

wordpress - Membership plugin : Can someone sign up using a fake email address? -

i'm building membership site using wordpress , membership plugin . the site still on localhost. did trial sign ups , worked well. noticed that, can use fake email address such xyz@gmail.com or sign , create account. that's problem. don't know how work when moved site server. but guys think security hole ? and can solution ? here's suggest: on registration page, add field users need enter special code complete registration , make code image (or @ least robots cannot process easy). prevent robots signing new accounts bogus information. next, perform basic email validation make sure format correct. next, strip email address user entered , verify domain part correct , if is, have server automatically send email new account holder asking him/her return special section of site he/she enters special registration code assigned him/her complete registration. also, save database space (i'm assuming registration info stored in one), ask users comple

How to find the correct answer in a random generated array in an android quiz? -

i know how make button green when it's clicked if holds correct answer. don't know button holds correct answer because randomly generated. i've put in code when button clicked kind of sleeps second , moves new question button turns green time activity holds when new question generated turns in how was. public class glavno extends activity implements onclicklistener { final handler handler = new handler(); int score = 0; int counter = 0; boolean ajme = true; textview textview1, textview2, textview3, countdown; button btn1, btn2, btn3, btn4; arraylist<question> qsts = new arraylist<question>(); list<integer> generated = new arraylist<integer>(); arraylist<string> allanswers = new arraylist<string>(); random rng = new random(); question nextquestion; question qjedan = new question( "q1", "correct answer - q1", "wrong answer 3 - q1", "wrong answer 3 - q1

ldap - Sitecore Active Directory Indirect Membership -

we have sitecore 6.5 ad module 1.0.4. users in ad group department\sitecoreusers can login sitecore, users in department\sitecore_role1 group cannot login though department\sitecore_role1 group member of sitecore_users. the ldap.includeindirectmembership set true , groups have membership in domain\sitecoreusers show in role manager. have tried adding sitecore_role1 role member of sitecore\sitecore client users, still did not allow sitecore_role1 members login. do of our ad users have added both sitecore_role group , sitecore_users group? thought belonging member groups should allow them login sitecore. can please set me straight? i have worked though sitecore ad module admin guide , think have set correctly, here think relevant settings review. the connection string being used is: <add name="wudosisconnectionstring" connectionstring="ldap://wudosis.wustl.edu:389/dc=department,dc=ourorg,dc=edu"/> and our ad set - department + groups

javascript - Multiplayer game movement synchronization -

i'm working on multiplayer game , i'm having problem synchronizing players. when player presses 1 of move keys (w,a,s,d) client sends packet pressed button, server sets velocity according pressed key , sends nearby players new velocity. when player release key clients sends packet, server sets player velocity 0,0 , sends position , velocity nearby players. so problem when release key, of time player jumps back. how fix this? i'm using socket.io. client side: socket.on('positionentity', function (data) { console.log((data.x - entities[data.id].x)+" "+(data.y - entities[data.id].y)); entities[data.id].setposition(data); }); $(document).keyup(function(e) { if (e.keycode == 87) { keys.w = false; socket.emit("stopmove", {dir: 0, time: date.now()}); } if (e.keycode == 65) { keys.a = false; socket.emit("stopmove", {dir: 1, tim

mongodb - Drupal 7 views block with default value contextual filter does not filter on page (Mongo) -

tl;dr: views block, contextual filter, default value. results show in preview, not on page. page = taxonomy term page path alias. running on mongo. ===== how problem differs other contextual filter block issues i've seen: - using mongo - have default value set on contextual filter - results show in views preview, not on page using drupal 7 on mongo, efq views, need display nodes of nodetype have been tagged term term, on term page. (with drupal on mongo, taxonomy index stored in mysql node content in mongo, term pages don't work expected, , return no content. view necessary establish functionality. <-- yes, stupid.) my taxonomy entity own fields, & tagged content appears in block, below terms own fields. (this why didn't make page view display tagged content -- bc. must display term's own fields.) taxonomy term pages have path alias, "vocab/term-name". configurations i've tried work in preview not on page: 1: using path alias.

c# - Scrolling in a ItemsControl while using a horizontal StackPanel as the ItemsPanel -

i have itemscontrol , i've built items i'm displaying in ( views:displaygroupview ) in such way expand horizontally show contents , not vertically (only using available height) i've changed itemspanel of itemscontrol use stackpanel orientation="horizontal" layout wise it's perfect, no matter can't scroll horizontally can see everything. this xaml itemscontrol : <itemscontrol itemssource="{binding displaygroups}" grid.row="1" margin="120,20,120,20" verticalcontentalignment="stretch"> <itemscontrol.itemspanel> <itemspaneltemplate > <stackpanel orientation="horizontal" scrollviewer.horizontalscrollmode="enabled" scrollviewer.horizontalscrollbarvisibility="visible"/> </itemspaneltemplate> </itemscontrol.itemspanel> <itemscontrol.itemtemplate> <datatempl